Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( C = new(Config) A = new(Application) )
Functions ¶
func ReplaceApplication ¶
func ReplaceApplication(app Application)
ReplaceApplication replaces the application.
Types ¶
type Application ¶
type Application struct { Name string `json:"name" yaml:"name"` Version string `json:"version" yaml:"version"` ClientID string `json:"client_id" yaml:"clientID"` ClientSecret string `json:"client_secret" yaml:"clientSecret"` Token string `json:"token" yaml:"token"` Log logging.Config `json:"log" yaml:"log"` HTTP HTTP `json:"http" yaml:"http"` LineBot LineBot `json:"line_bot" yaml:"lineBot"` Storage struct { Mongodb struct { DSN string `json:"dsn" yaml:"dsn"` } `json:"mongodb" yaml:"mongodb"` Influxdb struct { URL string `json:"url" yaml:"url"` Token string `json:"token" yaml:"token"` } `json:"influxdb" yaml:"influxdb"` Redis struct { Addr string `json:"addr" yaml:"addr"` Password string `json:"password" yaml:"password"` DB int `json:"db" yaml:"db"` } `json:"redis" yaml:"redis"` } `json:"storage" yaml:"storage"` MessageQueue struct { Kafka struct { Brokers []string `json:"brokers" yaml:"brokers"` GroupID string `json:"group_id" yaml:"groupID"` Topic string `json:"topic" yaml:"topic"` Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` } `json:"kafka" yaml:"kafka"` } `json:"mq" yaml:"mq" mapstructure:"mq"` }
Application defines the application struct.
func (*Application) String ¶
func (a *Application) String() string
type Config ¶
type Config struct { Log logging.Config `json:"log" yaml:"log"` HTTP HTTP `json:"http" yaml:"http"` GRPC GRPC `json:"grpc" yaml:"grpc"` Cronjob Cronjob `json:"cronjob" yaml:"cronjob"` Storage Storage `json:"storage" yaml:"storage"` LineNotify LineNotify `json:"line_notify" yaml:"lineNotify"` ShortenURL Application `json:"shorten_url" yaml:"shortenURL"` Ekko Application `json:"ekko" yaml:"ekko"` Stringx Application `json:"stringx" yaml:"stringx"` Orianna Application `json:"orianna" yaml:"orianna"` Sion Application `json:"sion" yaml:"sion"` ReURL Application `json:"reurl" yaml:"reurl"` Finmind Application `json:"finmind" yaml:"finmind"` IRent Application `json:"irent" yaml:"irent"` }
Config defines the config struct.
type Cronjob ¶
type Cronjob struct {
Interval int `json:"interval" yaml:"interval"`
}
Cronjob defines the cronjob config struct.
type HTTP ¶
type HTTP struct { URL string `json:"url" yaml:"url"` Host string `json:"host" yaml:"host"` Port int `json:"port" yaml:"port"` Mode string `json:"mode" yaml:"mode"` }
HTTP defines the http config struct.
type LineBot ¶
type LineBot struct { Secret string `json:"secret" yaml:"secret"` Token string `json:"token" yaml:"token"` }
LineBot defines the line bot config struct.
type LineNotify ¶
type LineNotify struct { Endpoint string `json:"endpoint" yaml:"endpoint"` AccessToken string `json:"access_token" yaml:"accessToken"` }
LineNotify defines the line notify config struct.
Click to show internal directories.
Click to hide internal directories.