Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorStatus ¶
ErrorStatus reports the error status of the top most governor error in the chain
Types ¶
type Config ¶
type Config struct { Appname string Version string VersionHash string LogLevel int LogOutput io.Writer Port string BaseURL string PublicDir string MaxReqSize string FrontendProxy []string Origins []string RouteRewrite map[string]string // contains filtered or unexported fields }
Config is the complete server configuration including the dynamic (runtime) options
type ConfigOpts ¶
type ConfigOpts struct { DefaultFile string Appname string Description string Version string VersionHash string EnvPrefix string }
ConfigOpts is the server base configuration
type ConfigReader ¶
type ConfigReader interface { Name() string URL() string GetStrMap(key string) map[string]string GetBool(key string) bool GetInt(key string) int GetStr(key string) string GetStrSlice(key string) []string }
ConfigReader gets values from the config parser
type ConfigRegistrar ¶
type ConfigRegistrar interface {
SetDefault(key string, value interface{})
}
ConfigRegistrar sets default values on the config parser
type JobRegistrar ¶
type JobRegistrar interface { }
type Logger ¶
type Logger interface { Debug(msg string, data map[string]string) Info(msg string, data map[string]string) Warn(msg string, data map[string]string) Error(msg string, data map[string]string) Fatal(msg string, data map[string]string) Subtree(module string) Logger WithData(data map[string]string) Logger }
Logger is a governor logging interface that may write logs to a configurable io.Writer
type ReqSetup ¶
type ReqSetup struct { Username string `json:"username"` Password string `json:"password"` Email string `json:"email"` Firstname string `json:"first_name"` Lastname string `json:"last_name"` Orgname string `json:"orgname"` }
ReqSetup is the option struct that is passed to all services during setup
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a governor server to which services may be registered
func (*Server) Register ¶
Register adds the service to the governor Server and runs service.Register
type Service ¶
type Service interface { Register(r ConfigRegistrar, jr JobRegistrar) Init(ctx context.Context, c Config, r ConfigReader, l Logger, g *echo.Group) error Setup(req ReqSetup) error Start(ctx context.Context) error Stop(ctx context.Context) Health() error }
Service is an interface for governor services
A governor service may be in one of 5 stages in its lifecycle.
1. Register: register the service on the config
2. Init: initialize any connections necessary for the service to function
3. Setup: sets up the service for the first time such as creating database tables and mounting routes
4. Start: start the service
5. Stop: stop the service
Register and Init always occur first when a governor application is launched. Then Setup and Start may occur in either order, or not at all. Stop runs when the server begins the shutdown process
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
service
|
|
courier
Code generated by go generate forge validation v0.2.0.
|
Code generated by go generate forge validation v0.2.0. |
courier/model
Code generated by go generate forge model v0.2.0.
|
Code generated by go generate forge model v0.2.0. |
profile
Code generated by go generate forge validation v0.2.0.
|
Code generated by go generate forge validation v0.2.0. |
profile/model
Code generated by go generate forge model v0.2.0.
|
Code generated by go generate forge model v0.2.0. |
state/model
Code generated by go generate forge model v0.2.0.
|
Code generated by go generate forge model v0.2.0. |
user
Code generated by go generate forge validation v0.2.0.
|
Code generated by go generate forge validation v0.2.0. |
user/model
Code generated by go generate forge model v0.2.0.
|
Code generated by go generate forge model v0.2.0. |
user/role/model
Code generated by go generate forge model v0.2.0.
|
Code generated by go generate forge model v0.2.0. |
user/session/model
Code generated by go generate forge model v0.2.0.
|
Code generated by go generate forge model v0.2.0. |
util
|
|