Documentation ¶
Index ¶
- Constants
- type Asynchronous
- type Cache
- type CacheValue
- type CommitFn
- type Config
- type Context
- func (c Context) BeginTransaction() Context
- func (c Context) Cfg() Config
- func (c Context) CommitTx() error
- func (c Context) IsDev() bool
- func (c Context) IsProd() bool
- func (c Context) IsSystemInitialized() bool
- func (c Context) Log() Logger
- func (c Context) MaxFileSizeInBytes() uint64
- func (c Context) RegisterCommitFn(commitFn CommitFn)
- func (c Context) RegisterRollbackFn(rollbackFn RollbackFn)
- func (c Context) RepositoryDriver() RepositoryDriver
- func (c Context) Request() Request
- func (c Context) RollbackTx(err error) error
- func (c Context) RootDocumentID() ID
- func (c Context) Session() Session
- func (c Context) StorageDocumentID() ID
- func (c Context) StorageDriver() StorageDriver
- func (c Context) TX() *sqlx.Tx
- func (c Context) UseAsync(async Asynchronous) Context
- func (c Context) UseCache(cache Cache) Context
- func (c Context) UseConfig(config Config) Context
- func (c Context) UseDB(db *sqlx.DB) Context
- func (c Context) UseLogger(logger Logger) Context
- func (c Context) UseMaxFileSizeInBytes(size uint64) Context
- func (c Context) UseRepositoryDriver(driver RepositoryDriver) Context
- func (c Context) UseRequest(req *http.Request, routePath string) Context
- func (c Context) UseRootDocumentID(id ID) Context
- func (c Context) UseSession(session Session) Context
- func (c Context) UseStorageDocumentID(id ID) Context
- func (c Context) UseStorageDriver(driver StorageDriver) Context
- func (c Context) UseSystemInitialize(initialized bool) Context
- type ID
- type Job
- type Level
- type Logger
- type ParamValue
- type Params
- type Path
- type Queue
- type RepositoryDriver
- type Request
- func (r Request) Body(w http.ResponseWriter) io.ReadCloser
- func (r Request) CurrentRole() string
- func (r Request) FullPath() string
- func (r Request) Host() string
- func (r Request) IPAddress() string
- func (r Request) IsAuthenticated() bool
- func (r Request) Method() string
- func (r Request) Path() string
- func (r Request) QueryParams() Params
- type RollbackFn
- type Session
- type StorageDriver
- type WorkerPool
Constants ¶
View Source
const ( LogKeyStatus = "status" LogKeyIPAddress = "ipAddress" LogKeyParams = "params" LogKeyMethod = "method" LogKeyHost = "host" LogKeyPath = "path" LogKeyTraceID = "traceId" LogKeyAsyncTraceID = "asyncTraceId" )
View Source
const DefaultMode = DevelopmentMode
DefaultMode is the default mode of the backend
View Source
const DevelopmentMode = "development"
DevelopmentMode indicates the backend is running in development mode This mode trades security for ease of use (Such as using unsecure cookies)
View Source
const MaxBodySize = 10 * 1024 * 1024 // 10MB
View Source
const MaxCommitFns = 1024
View Source
const MaxRollbackFns = 1024
View Source
const ProductionMode = "production"
ProductionMode indicates the backend is running in production mode This mode has the highest level of security
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheValue ¶
type Config ¶
type Config interface { GetAppName() string GetVersion() string GetMode() string GetDomain() string GetAllowableOrigin() string GetCacheHost() string GetCachePort() int32 GetCachePassword() string GetDBHost() string GetDBPort() int32 GetDBName() string GetDBUser() string GetDBPassword() string GetDBSSLMode() string GetJWTSecret() string GetJWTExpireIn() time.Duration DebugModeEnabled() bool GetEmailVerificationExpiresIn() time.Duration GetPasswordResetExpiresIn() time.Duration GetTestDatabaseConnection() string GetTimeoutInSeconds() time.Duration }
Configuration is the main configuration file loader. The format is expected to be a toml file
type Context ¶
func NewAsyncContext ¶
func NewContext ¶
func NewContext() Context
func (Context) BeginTransaction ¶
func (Context) Cfg ¶
Cfg returns the context configuration A config object must be set in every context, so if one does not exist, panic
func (Context) IsSystemInitialized ¶
func (Context) MaxFileSizeInBytes ¶
func (Context) RegisterCommitFn ¶
func (Context) RegisterRollbackFn ¶
func (c Context) RegisterRollbackFn(rollbackFn RollbackFn)
func (Context) RepositoryDriver ¶
func (c Context) RepositoryDriver() RepositoryDriver
func (Context) RollbackTx ¶
func (Context) RootDocumentID ¶
func (Context) StorageDocumentID ¶
func (Context) StorageDriver ¶
func (c Context) StorageDriver() StorageDriver
func (Context) UseAsync ¶
func (c Context) UseAsync(async Asynchronous) Context
func (Context) UseMaxFileSizeInBytes ¶
func (Context) UseRepositoryDriver ¶
func (c Context) UseRepositoryDriver(driver RepositoryDriver) Context
func (Context) UseRequest ¶
func (Context) UseRootDocumentID ¶
func (Context) UseSession ¶
func (Context) UseStorageDocumentID ¶
func (Context) UseStorageDriver ¶
func (c Context) UseStorageDriver(driver StorageDriver) Context
func (Context) UseSystemInitialize ¶
type ParamValue ¶
type ParamValue string
func (ParamValue) AsInt ¶
func (p ParamValue) AsInt(defaultValue int) int
func (ParamValue) AsString ¶
func (p ParamValue) AsString() string
type Params ¶
type Params map[string][]ParamValue
func (Params) Get ¶
func (p Params) Get(key string) ParamValue
func (Params) GetAllByKey ¶
func (p Params) GetAllByKey(key string) []ParamValue
type RepositoryDriver ¶
type RepositoryDriver string
const (
RepositoryDriverPostgres RepositoryDriver = "postgres"
)
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (Request) Body ¶
func (r Request) Body(w http.ResponseWriter) io.ReadCloser
func (Request) CurrentRole ¶
func (Request) IsAuthenticated ¶
func (Request) QueryParams ¶
type RollbackFn ¶
type WorkerPool ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.