Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Counter errors. ErrCounterCreateFailed = Error("Failed to create counter.") ErrCounterDestroyFailed = Error("Failed to remove counter.") // CounterVec errors. ErrCounterVecCreateFailed = Error("Failed to create counter vector.") // Errors used for testing. ErrNoMatch = Error("No alert matched in alert config.") // User Registry errors. ErrUserNotFoundByID = Error("User not found by ID.") ErrUserNotFoundByUsername = Error("User not found by Username.") ErrUnauthorizedAPI = Error("Unauthorized API access.") // Generic gRPC errors. ErrRecordAlreadyExists = Error("Record already exists.") ErrRecordConversionToDBFailed = Error("Record conversion to DB format failed.") ErrRecordConversionToPBFailed = Error("Record conversion to PB format failed.") ErrRecordDeleteFailed = Error("Record delete failed.") ErrRecordDoesNotExist = Error("Record does not exist.") ErrRecordInsertFailed = Error("Record insert failed.") ErrRecordUpdateFailed = Error("Record update failed.") // Message validation errors. ErrClientMsgValidationFailed = Error("Client message validation failed.") ErrServerMsgValidationFailed = Error("Server message validation failed.") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Config *AppConfig
Secrets *AppSecrets
}
App represents the application's metadata, configuration and secrets.
type AppConfig ¶
type AppConfig struct {
LogLevel string `json:"log_level" yaml:"log_level"`
ServerHost string `json:"server_host" yaml:"server_host"`
ServerPort int `json:"server_port" yaml:"server_port"`
}
AppConfig represents the application's configuration.
type AppSecrets ¶
type AppSecrets struct {
AuthToken string `json:"auth_token" yaml:"auth_token"`
}
AppSecrets represents the application's secrets.
type Logger ¶
type Logger interface {
Fatalf(message string, args ...interface{})
Panicf(message string, args ...interface{})
Debugf(message string, args ...interface{})
Errorf(message string, args ...interface{})
Infof(message string, args ...interface{})
LogLevel() string
SetLevel(string)
Tracef(message string, args ...interface{})
Warningf(message string, args ...interface{})
WithError(error) Logger
WithField(string, interface{}) Logger
WithFields(map[string]interface{}) Logger
AutoClearFields(bool)
SetOutput(io.Writer)
}
Methods required for a logger.
Click to show internal directories.
Click to hide internal directories.