cfg

package
v0.0.0-...-4b97b8a Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package cfg is the configuration package hold all config objects

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthProvider

type AuthProvider struct {
	Provider  string
	ClientKey string
	Secret    string
	Domain    string // If needed, like with auth0
	Scopes    []string
}

AuthProvider defines the configuration for the Goth config

type Cache

type Cache struct {
	Server   string
	Password string
	Timeout  string // time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". ex: 500ms
}

Cache defines the configuration for the cache

type DB

type DB struct {
	Dialect     string
	DSN         string
	SeedDB      bool
	LogMode     bool
	AutoMigrate bool
	MaxCon      int
	MaxIdleCon  int
}

DB defines the configuration for the DB config

type JWT

type JWT struct {
	Secret    string
	Algorithm string
}

JWT defines the options for JWT tokens

type MongoDB

type MongoDB struct {
	Dialect  string
	Host     string
	Database string
}

MongoDB defines the configuration for the mongo DB config

type Sentry

type Sentry struct {
	Enabled          bool
	Debug            bool
	DSN              string
	TracesSampleRate float64
}

Sentry defines the configuration for the Sentry monitoring

type Server

type Server struct {
	ServiceName    string
	Version        string
	Env            string
	Host           string
	Port           string
	URISchema      string
	ServiceVersion string
	SessionSecret  string
	JWT            JWT
	Cache          Cache
	Database       DB
	MDB            MongoDB
	Sentry         Sentry
	AuthProviders  []AuthProvider
}

Server defines the configuration for the server

func (*Server) ListenEndpoint

func (s *Server) ListenEndpoint() string

ListenEndpoint builds the endpoint string (host + port)

func (*Server) SchemaVersionedEndpoint

func (s *Server) SchemaVersionedEndpoint(path string) string

SchemaVersionedEndpoint builds the schema endpoint string (schema + host + port + version)

func (*Server) VersionedEndpoint

func (s *Server) VersionedEndpoint(path string) string

VersionedEndpoint builds the endpoint `string (host + port + version)

Jump to

Keyboard shortcuts

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