Documentation
¶
Index ¶
- Variables
- func BuildAPIURL(subpaths ...string) string
- func NewAppConfig() error
- func NewErrorWithLocf(code models.ErrorCode, loc []string, format string, a ...any) error
- func NewErrorf(code models.ErrorCode, format string, a ...any) error
- func SetupSwaggerUI(url string, specPath, swaggerUIDir string) error
- func WrapErrorWithLocf(orig error, code models.ErrorCode, loc []string, format string, ...) error
- func WrapErrorf(orig error, code models.ErrorCode, format string, a ...any) error
- type AppConfig
- type AppEnv
- type Decoder
- type Error
- type OIDCConfig
- type PostgresConfig
- type RedisConfig
- type SuperAdminConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProjectNameByID = map[models.ProjectID]models.ProjectName{ 1: models.ProjectNameDemo, 2: models.ProjectNameDemoTwo, } ProjectIDByName = map[models.ProjectName]models.ProjectID{ models.ProjectNameDemo: 1, models.ProjectNameDemoTwo: 2, } )
View Source
var ( DemoKanbanStepsNameByID = map[models.KanbanStepID]models.DemoKanbanSteps{ 1: models.DemoKanbanStepsDisabled, 2: models.DemoKanbanStepsReceived, 3: models.DemoKanbanStepsUnderReview, 4: models.DemoKanbanStepsWorkInProgress, } DemoKanbanStepsIDByName = map[models.DemoKanbanSteps]models.KanbanStepID{ models.DemoKanbanStepsDisabled: 1, models.DemoKanbanStepsReceived: 2, models.DemoKanbanStepsUnderReview: 3, models.DemoKanbanStepsWorkInProgress: 4, } )
View Source
var ( DemoWorkItemTypesNameByID = map[models.WorkItemTypeID]models.DemoWorkItemTypes{ 1: models.DemoWorkItemTypesType1, } DemoWorkItemTypesIDByName = map[models.DemoWorkItemTypes]models.WorkItemTypeID{ models.DemoWorkItemTypesType1: 1, } )
View Source
var ( DemoTwoKanbanStepsNameByID = map[models.KanbanStepID]models.DemoTwoKanbanSteps{ 5: models.DemoTwoKanbanStepsReceived, } DemoTwoKanbanStepsIDByName = map[models.DemoTwoKanbanSteps]models.KanbanStepID{ models.DemoTwoKanbanStepsReceived: 5, } )
View Source
var ( DemoTwoWorkItemTypesNameByID = map[models.WorkItemTypeID]models.DemoTwoWorkItemTypes{ 2: models.DemoTwoWorkItemTypesType1, 3: models.DemoTwoWorkItemTypesType2, 4: models.DemoTwoWorkItemTypesAnotherType, } DemoTwoWorkItemTypesIDByName = map[models.DemoTwoWorkItemTypes]models.WorkItemTypeID{ models.DemoTwoWorkItemTypesType1: 2, models.DemoTwoWorkItemTypesType2: 3, models.DemoTwoWorkItemTypesAnotherType: 4, } )
View Source
var DemoKanbanStepsStepOrderByID = map[models.KanbanStepID]int{
1: 0,
2: 1,
3: 2,
4: 3,
}
View Source
var DemoTwoKanbanStepsStepOrderByID = map[models.KanbanStepID]int{
5: 1,
}
Functions ¶
func BuildAPIURL ¶
BuildAPIURL returns a fully-qualified URL with the given path elements accounting for reverse proxy configuration.
func NewAppConfig ¶
func NewAppConfig() error
NewAppConfig initializes app config from current environment variables. config can be replaced with subsequent calls.
func NewErrorWithLocf ¶
NewErrorWithLocf instantiates a new error with error location.
func SetupSwaggerUI ¶
SetupSwaggerUI sets url in the Swagger docs to the endpoint where specPath is served.
Types ¶
type AppConfig ¶
type AppConfig struct { Postgres PostgresConfig Redis RedisConfig OIDC OIDCConfig SuperAdmin SuperAdminConfig Domain string `env:"DOMAIN"` APIPort string `env:"API_PORT"` APIVersion string `env:"API_VERSION"` ReverseProxyAPIPrefix string `env:"REVERSE_PROXY_API_PREFIX"` ProjectPrefix string `env:"PROJECT_PREFIX"` AppEnv AppEnv `env:"APP_ENV"` SigningKey string `env:"SIGNING_KEY"` BuildVersion string `env:"BUILD_VERSION,-"` CookieDomain string `env:"COOKIE_DOMAIN"` LoginCookieKey string `env:"LOGIN_COOKIE_KEY"` ScopePolicyPath string `env:"SCOPE_POLICY_PATH"` RolePolicyPath string `env:"ROLE_POLICY_PATH"` }
AppConfig contains app settings.
var ( // Config returns the app global config initialized from environment variables. // [Read] locks not needed if there are no writes involved. Config is only populated at startup so there won't be any more writes. Config *AppConfig )
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error represents an error that could be wrapping another error, It includes a code for determining what triggered the error.
type OIDCConfig ¶
type PostgresConfig ¶
type PostgresConfig struct { // Port represents the db port to use in the application, depending on setup (dockerized or not). Port int `env:"DB_PORT"` User string `env:"POSTGRES_USER"` Password string `env:"POSTGRES_PASSWORD"` Server string `env:"POSTGRES_SERVER"` DB string `env:"POSTGRES_DB"` TraceEnabled bool `env:"POSTGRES_TRACE,false"` }
type RedisConfig ¶
type SuperAdminConfig ¶
type SuperAdminConfig struct {
DefaultEmail string `env:"DEFAULT_SUPERADMIN_EMAIL"`
}
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
gen-schema generates OpenAPI v3 schema portions from code.
|
gen-schema generates OpenAPI v3 schema portions from code. |
envvartesting
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
pb
|
|
python-ml-app-protos/tfidf/v1/v1testing
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
postgresql/gen/models
Package models provides primitives to interact with the openapi HTTP API.
|
Package models provides primitives to interact with the openapi HTTP API. |
repostesting
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
*
|
* |
resttesting
Package resttesting provides primitives to interact with the openapi HTTP API.
|
Package resttesting provides primitives to interact with the openapi HTTP API. |
nolint: gosec
|
nolint: gosec |
utils
|
|
Click to show internal directories.
Click to hide internal directories.