context

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2025 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL