api

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(conf Config) (http.Handler, error)

func NewRouter

func NewRouter(handlers *domain.Handler, auth, githubAuth vel.Middleware, middlewares ...vel.Middleware) *vel.Router

Types

type Config

type Config struct {
	JwtKey    string        `envconfig:"JWT_KEY" required:"true"`
	JwtSecret StringBase64  `envconfig:"JWT_SECRET" required:"true"`
	JwtTtl    time.Duration `envconfig:"JWT_TTL" default:"5m"`

	DoToken        string `envconfig:"DO_TOKEN" required:"true"`
	DockerRegistry string `envconfig:"DOCKER_REGISTRY" required:"true"`

	DbDsn         string `envconfig:"DB_DSN" required:"true"`
	MigrationsDir string `envconfig:"MIGRATIONS_DIR" required:"true"`

	HttpPort string `envconfig:"HTTP_PORT" default:"8000"`

	AuthID       string       `envconfig:"AUTH_ID" required:"true"`
	AuthSecret   StringBase64 `envconfig:"AUTH_SECRET" required:"true"`
	AuthKeyID    string       `envconfig:"AUTH_KEY_ID" required:"true"`
	AuthEndpoint string       `envconfig:"AUTH_ENDPOINT" required:"true"`

	GithubWebhookSecret       string `envconfig:"GITHUB_WEBHOOK_SECRET" required:"true"`
	GithubWebhookSecretEnable bool   `envconfig:"GITHUB_WEBHOOK_SECRET_ENABLE" default:"true"`

	BuilderPackage string `envconfig:"BUILDER_PACKAGE" required:"false"`
}

func NewConfig

func NewConfig() (Config, error)

type StringBase64

type StringBase64 string

func (*StringBase64) Decode

func (s *StringBase64) Decode(value string) error

Jump to

Keyboard shortcuts

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