Documentation ¶
Index ¶
Constants ¶
View Source
const ( PostgresAppUrlEnvKey = "POSTGRES_APP_URL" RepositoryBaseEnvKey = "REPOSITORY_BASE" AuthorizationHeader = "authorization" IDHeader = "x-grokloc-id" TokenRequestHeader = "x-grokloc-token-request" // #nosec G101 MaxBodySize = 8192 APIPath = "/api/" )
Variables ¶
View Source
var ErrorBody = fmt.Errorf("body malformed or exceeds %v bytes", MaxBodySize)
View Source
var ErrorEnvVar = errors.New("missing or malformed environment variable")
View Source
var ErrorInadequateAuthorization = errors.New("inadequate authorization provided")
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct { // Level describes the environment the State is set in Level env.Level // Logger is the default state logger Logger *slog.Logger // APIVersion is the expected runtime supported api version APIVersion string // Master is a pool of conns to the master db Master *pgxpool.Pool // Replicas is a pool of conns to the replica dbs Replicas []*pgxpool.Pool // ConnTimeout is a timeout to acquire a db conn ConnTimeout time.Duration // ExecTimeout is a timeout for executing a db query ExecTimeout time.Duration // Argon2Config for password hashing Argon2Config argon2.Config // RepositoryBase is the path where checked out repos are found RepositoryBase string // SigningKey signs JWTs SigningKey []byte // VersionKey maps key ids to database encryption keys VersionKey *security.VersionKey // DefaultRole is the environment role default for models instance DefaultRole models.Role // Root user Root *user.User // Root org Org *org.Org }
State contains all references and values that must be available for the duration of an app run.
func (*State) RandomReplica ¶
RandomReplica selects a random replica.
Directories ¶
Path | Synopsis |
---|---|
admin
|
|
org
Package org contains package methods for org support.
|
Package org contains package methods for org support. |
user
Package user contains package methods for user support.
|
Package user contains package methods for user support. |
handlers/ok
Package ok provides an unauthenticated healthcheck handler.
|
Package ok provides an unauthenticated healthcheck handler. |
package audit provides mutation recording.
|
package audit provides mutation recording. |
git
|
|
repository
Package repository contains package methods for git repository support.
|
Package repository contains package methods for git repository support. |
Package jwt provides token functionality.
|
Package jwt provides token functionality. |
Package models provides shared model definitions.
|
Package models provides shared model definitions. |
state
|
|
unit
Package unit manages state for the Unit environment.
|
Package unit manages state for the Unit environment. |
Package testing provides test utility functions.
|
Package testing provides test utility functions. |
Click to show internal directories.
Click to hide internal directories.