Files

3.6 KiB

config

import "github.com/Akilan1999/p2p-rendering-computation/config"

Index

func GetCurrentPath

func GetCurrentPath() (string, error)

GetCurrentPath Getting P2PRC Directory from environment variable

func GetEnvName

func GetEnvName() string

func GetPathP2PRC

func GetPathP2PRC(Envname string) (string, error)

GetPathP2PRC Getting P2PRC Directory from environment variable

func SetEnvName

func SetEnvName(EnvName string) error

SetEnvName Sets the environment name This is to ensure that the Path of your project is detected from your environment variable This is useful when extending the use case of P2PRC

type Config

type Config struct {
    MachineName              string
    IPTable                  string
    DockerContainers         string
    DefaultDockerFile        string
    DockerRunLogs            string
    SpeedTestFile            string
    IPV6Address              string
    PluginPath               string
    TrackContainersPath      string
    ServerPort               string
    ProxyPort                string
    GroupTrackContainersPath string
    FRPServerPort            string
    BehindNAT                string
    IPTableKey               string
    PublicKeyFile            string
    PrivateKeyFile           string
    PemFile                  string
    KeyFile                  string
    BareMetal                bool
    UnsafeMode               bool
    CustomConfig             interface{}
}

func ConfigInit

func ConfigInit(defaultsParameter map[string]interface{}, CustomConfig interface{}, envNameOptional ...string) (*Config, error)

ConfigInit Pass environment name as an optional parameter

func (*Config) GetPublicKey

func (c *Config) GetPublicKey() (string, error)

GetPublicKey Gets public key of the current machine based on the path provided on the config file

func (*Config) WriteConfig

func (c *Config) WriteConfig() error

Generated by gomarkdoc