Documentation
¶
Index ¶
- func InitConfig(configPath string)
- type ServerContext
- func (ctx *ServerContext) AuthAPI() *authentication.Authentication
- func (ctx *ServerContext) AuthManagementAPI() *management.Management
- func (ctx *ServerContext) Context() context.Context
- func (ctx *ServerContext) Database() *server.Database
- func (ctx *ServerContext) Logger() *slog.Logger
- func (ctx *ServerContext) WithAuthAPI(domain string, clientId string, clientSecret string)
- func (ctx *ServerContext) WithDatabase(ipAddress string, port int, username string, password string)
- func (ctx *ServerContext) WithLog(logPath string)
- func (ctx *ServerContext) WithManagementAPI(domain string, clientId string, clientSecret string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
func InitConfig(configPath string)
InitConfig - Initialize viper to parse our config file or use environmental varibales to provide the values we need. Additionally, a config path can be passed to the function to override the default value
Types ¶
type ServerContext ¶
type ServerContext struct {
// contains filtered or unexported fields
}
ServerContext -
func NewServerContext ¶ added in v1.3.2
func NewServerContext() *ServerContext
NewServerContext - Constructor for the server context. Returns an empty pointer to the server context
func (*ServerContext) AuthAPI ¶ added in v1.3.2
func (ctx *ServerContext) AuthAPI() *authentication.Authentication
AuthAPI - Return a pointer to the Auth0 Authentication API struct
func (*ServerContext) AuthManagementAPI ¶ added in v1.3.2
func (ctx *ServerContext) AuthManagementAPI() *management.Management
AuthManagementAPI - Return a pointer to the Auth Management API struct
func (*ServerContext) Context ¶ added in v1.3.2
func (ctx *ServerContext) Context() context.Context
Context - Return a copy of the context used for the Database
func (*ServerContext) Database ¶ added in v1.3.2
func (ctx *ServerContext) Database() *server.Database
Database - Return a pointer to the MongoDB database
func (*ServerContext) Logger ¶ added in v1.3.2
func (ctx *ServerContext) Logger() *slog.Logger
Logger - Return a pointer to the slog logger used by the Server Context
func (*ServerContext) WithAuthAPI ¶ added in v1.3.2
func (ctx *ServerContext) WithAuthAPI(domain string, clientId string, clientSecret string)
WithAuthAPI - Sets the Auth0 Authentication API for the server context.
func (*ServerContext) WithDatabase ¶ added in v1.3.2
func (ctx *ServerContext) WithDatabase(ipAddress string, port int, username string, password string)
WithDatabase - Set the database instance for the server context. The database will be connected on calling this function
func (*ServerContext) WithLog ¶ added in v1.3.2
func (ctx *ServerContext) WithLog(logPath string)
WithLog - Set the logger for the server context
func (*ServerContext) WithManagementAPI ¶ added in v1.3.2
func (ctx *ServerContext) WithManagementAPI(domain string, clientId string, clientSecret string)
WithManagementAPI - Set the Auth0 Management API, for the server context