web

package
v0.0.0-...-bdc5b51 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package web contains the web service for the API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Local  bool `conf:"default:true"`
	Google providers.GoogleConfig
}

func (Auth) HasProvider

func (a Auth) HasProvider() bool

func (Auth) IsGoogleEnabled

func (a Auth) IsGoogleEnabled() bool

func (Auth) IsLocalEnabled

func (a Auth) IsLocalEnabled() bool

type Config

type Config struct {
	ServiceName    string        `conf:"default:gottl"`
	Host           string        `conf:"default:0.0.0.0"`
	Port           string        `conf:"default:8080"`
	IdleTimeout    time.Duration `conf:"default:30s"`
	ReadTimeout    time.Duration `conf:"default:10s"`
	WriteTimeout   time.Duration `conf:"default:10s"`
	AllowedOrigins string        `conf:"default:http://*,http://*"`
	EnableProfiler bool          `conf:"default:false"`
	Otel           otel.Config
	Google         providers.GoogleConfig
	Auth           Auth
}

func (Config) Addr

func (cfg Config) Addr() string

func (Config) Origins

func (cfg Config) Origins() []string

type Web

type Web struct {
	// contains filtered or unexported fields
}

func New

func New(
	build string,
	conf Config,
	logger zerolog.Logger,
	os *otel.OtelService,
	services *services.Service,
) *Web

func (*Web) Start

func (web *Web) Start(ctx context.Context) error

Start will start the web service and in another go routine block on the context when the context is done, it will shut down the server.

Directories

Path Synopsis
Package docs servces the swagger.json file.
Package docs servces the swagger.json file.
Package extractors contains extractor functions for getting data out of the request.
Package extractors contains extractor functions for getting data out of the request.
Package handlers contains the HTTP handlers for the application endpoints.
Package handlers contains the HTTP handlers for the application endpoints.
Package mid contains http middleware for the application.
Package mid contains http middleware for the application.
oauth
handlers
Package handlers provides the oauth handlers for the web server.
Package handlers provides the oauth handlers for the web server.
providers
Package providers contains the Oauth2 provider and config structs
Package providers contains the Oauth2 provider and config structs

Jump to

Keyboard shortcuts

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