Documentation ¶
Index ¶
Constants ¶
View Source
const ( NameDefault = "Timemore" URLDefault = "https://github.com/timemore" EmailDefault = "nop@e-mail.mailer.com" NotificationEmailSenderDefault = "no-reply@e-mail.mailer.com" TeamNameDefault = "Time More Team's" EnvDefault = "dev" DefaultTZLocation = "UTC" )
View Source
const EnvPrefixDefault = "APP_"
Variables ¶
This section is empty.
Functions ¶
func LoadEnvFiles ¶
func RunServers ¶
func RunServers(servers []ServiceServer)
func SetBuildInfo ¶
func TZLocation ¶
Types ¶
type App ¶
type App interface { AppInfo() Info InstanceID() string AddServer(ServiceServer) Run() IsAllServersAcceptingClients() bool }
func InitByEnvDefault ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func (*Base) AddServer ¶
func (appBase *Base) AddServer(srv ServiceServer)
AddServer adds a server to be run simultaneously. Do NOT call this method after the app has been started.
func (Base) InstanceID ¶
func (*Base) IsAllServersAcceptingClients ¶
IsAllServersAcceptingClients checks if every server is accepting clients.
type BuildInfo ¶
func GetBuildInfo ¶
func GetBuildInfo() BuildInfo
type Info ¶
type Info struct { // Name of the app Name string // URL Canonical URL of the app URL string TermsOfServiceURL string PrivacyPolicyURL string Email string NotificationEmailSender string TeamName string Env string TZLocation string // contains filtered or unexported fields }
func DefaultInfo ¶
func DefaultInfo() Info
type ServiceServer ¶
type ServiceServer interface { // ServerName returns the name of the server. This is 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.