Documentation ¶
Index ¶
Constants ¶
View Source
const ( NameDefault = "Kadisoka" URLDefault = "https://github.com/kadisoka" EmailDefault = "nop@example.com" NotificationEmailSenderDefault = "no-reply@example.com" TeamNameDefault = "Team Kadisoka" )
View Source
const EnvPrefixDefault = "APP_"
Variables ¶
This section is empty.
Functions ¶
func RunServers ¶
func RunServers(servers []ServiceServer)
func SetBuildInfo ¶
Types ¶
type App ¶
type App interface { AppInfo() Info InstanceID() string AddServer(ServiceServer) Run() IsAllServersAcceptingClients() bool }
func InitByEnvDefault ¶
type AppBase ¶
type AppBase struct {
// contains filtered or unexported fields
}
func (*AppBase) AddServer ¶
func (appBase *AppBase) AddServer(srv ServiceServer)
AddServer adds a server to be run simultaneously. Do NOT call this method after the app has been started.
func (AppBase) InstanceID ¶
func (*AppBase) IsAllServersAcceptingClients ¶
IsAllServersAcceptingClients checks if every server is accepting clients.
func (*AppBase) Run ¶
func (appBase *AppBase) Run()
Run runs all the servers. Do NOT add any new server after this method was called.
func (*AppBase) Servers ¶
func (appBase *AppBase) Servers() []ServiceServer
type BuildInfo ¶
func GetBuildInfo ¶
func GetBuildInfo() BuildInfo
type Info ¶
type Info struct { // Name of the app Name string // Canonical URL of the app URL string TermsOfServiceURL string PrivacyPolicyURL string Email string NotificationEmailSender string TeamName string }
func DefaultInfo ¶
func DefaultInfo() Info
type ServiceServer ¶
type ServiceServer interface { // ServerName returns the name of the server. This not to be unique. ServerName() string // Serve starts the server. This method is blocking and won't return // until the server is stopped (e.g., through Shutdown). Serve() error // Shutdown gracefully stops the server. Shutdown(ctx context.Context) error // IsAcceptingClients returns true if the service is ready to serve clients. IsAcceptingClients() bool // IsHealthy returns true if the service is considerably healthy. IsHealthy() bool }
ServiceServer abstracts all service servers
Click to show internal directories.
Click to hide internal directories.