Documentation ¶
Index ¶
Constants ¶
View Source
const ( EnvKeyConfFile = "AIICY_CONF_FILE" EnvKeyServiceMode = "AIICY_SERVICE_MODE" EnvKeyServiceName = "AIICY_SERVICE_NAME" EnvKeyServiceInstanceName = "AIICY_SERVICE_INSTANCE_NAME" EnvKeyServiceInstanceAddress = "AIICY_SERVICE_INSTANCE_ADDRESS" )
Env keys
View Source
const ( DefaultHubAddressTCP = "tcp://aiicy-hub:1883" DefaultHubAddressSSL = "ssl://aiicy-hub:8883" )
API keys
View Source
const (
// DefaultConfFile config path of the service by default
DefaultConfFile = "etc/aiicy/service.yml"
)
Path keys
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context interface { // InstanceName returns instance name. InstanceName() string // ServiceName returns service name. ServiceName() string // ConfFile returns config file. ConfFile() string // ServiceConfig returns service config. ServiceConfig() ServiceConfig // LoadCustomConfig loads custom config, if path is empty, will load config from default path. LoadCustomConfig(cfg interface{}, files ...string) error // returns logger interface Log() *logger.Logger // waiting to exit, receiving SIGTERM and SIGINT signals Wait() // returns wait channel WaitChan() <-chan os.Signal }
Context of service
type ServiceConfig ¶
type ServiceConfig struct { Hub mqtt.ClientConfig `yaml:"hub" json:"hub"` Logger logger.Config `yaml:"logger" json:"logger"` }
ServiceConfig base config of service
Click to show internal directories.
Click to hide internal directories.