Documentation ¶
Index ¶
- Constants
- Variables
- func APIAddr() string
- func ActorKeyset() set.Keyset
- func ActorLocation() string
- func ActorNick() string
- func DBEntities() string
- func DBHistory() string
- func DBPeers() string
- func Debug() bool
- func File() string
- func ForceFlag() bool
- func Generate(c Config)
- func GenerateFlag() bool
- func GetEditor() string
- func HelpNeeded() bool
- func HttpDebugSocket() string
- func HttpRefresh() int
- func HttpSocket() string
- func Init() error
- func InitCommon()
- func InitDB()
- func InitHTTP()
- func InitLog()
- func InitP2P()
- func LogFile() string
- func LogLevel() string
- func NodeIdentity() crypto.PrivKey
- func P2PConnMgrGracePeriod() time.Duration
- func P2PConnmgrHighWatermark() int
- func P2PConnmgrLowWatermark() int
- func P2PDiscoveryAdvertiseInterval() time.Duration
- func P2PDiscoveryAdvertiseLimit() int
- func P2PDiscoveryAdvertiseTTL() time.Duration
- func P2PDiscoveryDHT() bool
- func P2PDiscoveryMDNS() bool
- func P2PIdentity() (string, error)
- func P2PPort() int
- func P2PPortString() string
- func ParseActorFlags(exitOnHelp bool)
- func ParseCommonFlags(exitOnHelp bool)
- func Print(c Config)
- func PrintAll() (int, error)
- func Profile() string
- func Save(c Config) error
- func SetDefaultProfileName(p string)
- func ShowConfigFlag() bool
- func UIPeerslistWidth() int
- func VersionFlag() bool
- func XDGConfigHome() string
- func XDGDataHome() string
- type APIConfig
- type ActorConfig
- type Config
- type ConnmgrStruct
- type DBConfig
- type DiscoveryStruct
- type HTTPConfig
- type LogConfig
- type P2PConfig
- type UIConfig
- type UIStruct
Constants ¶
const ( NAME string = "go-ma-actor" VERSION string = "v0.3.1" ENV_PREFIX string = "GO_MA_ACTOR" )
const (
ALLOW_ALL_PEERS bool = true // Allow all peers by default. This is the norm for now. Use connmgr threshold and protection instead.
)
const CSVMode = 0664
Variables ¶
var ( ActorFlags = *pflag.NewFlagSet("actor", pflag.ContinueOnError) ErrEmptyIdentity = fmt.Errorf("identity is empty") ErrEmptyNick = fmt.Errorf("nick is empty") ErrFakeIdentity = fmt.Errorf("your identity is fake. You need to define actorKeyset or generate a new one") )
var (
CommonFlags = pflag.NewFlagSet("common", pflag.ContinueOnError)
)
Functions ¶
func ActorKeyset ¶ added in v0.2.2
func ActorLocation ¶ added in v0.2.4
func ActorLocation() string
func ActorNick ¶ added in v0.2.2
func ActorNick() string
Fetches the actor nick from the config or the command line NB! This is a little more complex than the other config functions, as it needs to fetch the nick from the command line if it's not in the config. Due to being a required parameter when generating a new keyset.
func DBEntities ¶ added in v0.4.0
func DBEntities() string
func File ¶ added in v0.3.1
func File() string
Returns the configfile name to use. The preferred value is the explcitily requested config file on the command line. Else it uses the nick of the actor or the mode.
func Generate ¶ added in v0.3.1
func Generate(c Config)
This is a function that'll handle generateing and possible printing of the config. You can called his after gerenating your config to properly handle generate and show-config flags.
func GenerateFlag ¶ added in v0.3.1
func GenerateFlag() bool
func HelpNeeded ¶ added in v0.4.0
func HelpNeeded() bool
func HttpDebugSocket ¶ added in v0.4.0
func HttpDebugSocket() string
func HttpRefresh ¶ added in v0.2.4
func HttpRefresh() int
func HttpSocket ¶ added in v0.2.4
func HttpSocket() string
func Init ¶ added in v0.0.2
func Init() error
This should be called after pflag.Parse() in main. If you want to use a specific config file, you need to call SetProfile() before Init().
func InitCommon ¶ added in v0.4.0
func InitCommon()
func NodeIdentity ¶ added in v0.2.4
func P2PConnMgrGracePeriod ¶ added in v0.2.4
func P2PConnmgrHighWatermark ¶ added in v0.2.4
func P2PConnmgrHighWatermark() int
func P2PConnmgrLowWatermark ¶ added in v0.2.4
func P2PConnmgrLowWatermark() int
func P2PDiscoveryAdvertiseInterval ¶ added in v0.3.0
func P2PDiscoveryAdvertiseLimit ¶ added in v0.3.0
func P2PDiscoveryAdvertiseLimit() int
func P2PDiscoveryAdvertiseTTL ¶ added in v0.3.0
func P2PDiscoveryDHT ¶ added in v0.3.0
func P2PDiscoveryDHT() bool
func P2PDiscoveryMDNS ¶ added in v0.3.0
func P2PDiscoveryMDNS() bool
func P2PIdentity ¶ added in v0.2.4
func P2PPortString ¶ added in v0.2.4
func P2PPortString() string
func ParseActorFlags ¶ added in v0.4.0
func ParseActorFlags(exitOnHelp bool)
Initialise command line flags for the actor package The actor is optional for some commands, but required for others. exitOnHelp means that this function is the last called when help is needed. and the program should exit.
func ParseCommonFlags ¶ added in v0.4.0
func ParseCommonFlags(exitOnHelp bool)
func Profile ¶ added in v0.3.0
func Profile() string
Profile is the mode unless overridden by the profile flag.
func Save ¶ added in v0.2.2
Write the generated config to the correct file NB! This fails fatally in case of an error.
func SetDefaultProfileName ¶ added in v0.4.0
func SetDefaultProfileName(p string)
Call this for special cmds like "relay", "node", etc. Before initConfig() like calls.
func ShowConfigFlag ¶ added in v0.3.1
func ShowConfigFlag() bool
func UIPeerslistWidth ¶ added in v0.3.0
func UIPeerslistWidth() int
func VersionFlag ¶ added in v0.4.0
func VersionFlag() bool
func XDGConfigHome ¶ added in v0.4.0
func XDGConfigHome() string
func XDGDataHome ¶ added in v0.4.0
func XDGDataHome() string
Types ¶
type ActorConfig ¶ added in v0.4.0
type ActorConfig struct { Identity string `yaml:"identity"` Nick string `yaml:"nick"` Location string `yaml:"location"` }
func Actor ¶ added in v0.4.0
func Actor() ActorConfig
Config for actor. Remember to parse the flags first. Eg. ActorFlags()
type ConnmgrStruct ¶ added in v0.4.0
type DBConfig ¶ added in v0.4.0
type DiscoveryStruct ¶ added in v0.4.0
type HTTPConfig ¶ added in v0.4.0
type HTTPConfig struct { Socket string `yaml:"socket"` Refresh int `yaml:"refresh"` DebugSocket string `yaml:"debug_socket"` }
func HTTP ¶ added in v0.4.0
func HTTP() HTTPConfig
type P2PConfig ¶ added in v0.4.0
type P2PConfig struct { Identity string `yaml:"identity"` Port int `yaml:"port"` Connmgr ConnmgrStruct `yaml:"connmgr"` Discovery DiscoveryStruct `yaml:"discovery"` }