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 Error
- type OIDCConfig
- type PostgresConfig
- type RedisConfig
- type SuperAdminConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProjectNameByID = map[db.ProjectID]models.Project{ 1: models.ProjectDemo, 2: models.ProjectDemoTwo, } ProjectIDByName = map[models.Project]db.ProjectID{ models.ProjectDemo: 1, models.ProjectDemoTwo: 2, } )
View Source
var ( DemoKanbanStepsNameByID = map[db.KanbanStepID]models.DemoKanbanSteps{ 1: models.DemoKanbanStepsDisabled, 2: models.DemoKanbanStepsReceived, 3: models.DemoKanbanStepsUnderReview, 4: models.DemoKanbanStepsWorkInProgress, } DemoKanbanStepsIDByName = map[models.DemoKanbanSteps]db.KanbanStepID{ models.DemoKanbanStepsDisabled: 1, models.DemoKanbanStepsReceived: 2, models.DemoKanbanStepsUnderReview: 3, models.DemoKanbanStepsWorkInProgress: 4, } )
View Source
var ( DemoTwoKanbanStepsNameByID = map[db.KanbanStepID]models.DemoTwoKanbanSteps{ 5: models.DemoTwoKanbanStepsReceived, } DemoTwoKanbanStepsIDByName = map[models.DemoTwoKanbanSteps]db.KanbanStepID{ models.DemoTwoKanbanStepsReceived: 5, } )
View Source
var ( DemoWorkItemTypesNameByID = map[db.WorkItemTypeID]models.DemoWorkItemTypes{ 1: models.DemoWorkItemTypesType1, } DemoWorkItemTypesIDByName = map[models.DemoWorkItemTypes]db.WorkItemTypeID{ models.DemoWorkItemTypesType1: 1, } )
View Source
var ( DemoTwoWorkItemTypesNameByID = map[db.WorkItemTypeID]models.DemoTwoWorkItemTypes{ 2: models.DemoTwoWorkItemTypesType1, 3: models.DemoTwoWorkItemTypesType2, 4: models.DemoTwoWorkItemTypesAnotherType, } DemoTwoWorkItemTypesIDByName = map[models.DemoTwoWorkItemTypes]db.WorkItemTypeID{ models.DemoTwoWorkItemTypesType1: 2, models.DemoTwoWorkItemTypesType2: 3, models.DemoTwoWorkItemTypesAnotherType: 4, } )
View Source
var DemoKanbanStepsStepOrderByID = map[db.KanbanStepID]int{
1: 0,
2: 1,
3: 2,
4: 3,
}
View Source
var DemoTwoKanbanStepsStepOrderByID = map[db.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"` APIPrefix string `env:"API_PREFIX"` AppEnv string `env:"APP_ENV"` SigningKey string `env:"SIGNING_KEY"` BuildVersion string `env:"BUILD_VERSION"` }
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 |
---|---|
Package client provides primitives to interact with the openapi HTTP API.
|
Package client provides primitives to interact with the openapi HTTP API. |
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. |
Package models provides primitives to interact with the openapi HTTP API.
|
Package models provides primitives to interact with the openapi HTTP API. |
pb
|
|
python-ml-app-protos/tfidf/v1/v1testing
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
repostesting
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
Package rest provides primitives to interact with the openapi HTTP API.
|
Package rest provides primitives to interact with the openapi HTTP API. |
utils
|
|
Click to show internal directories.
Click to hide internal directories.