web

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TZDBFile      = "tzdata/timezones.zip"
	TZVersionFile = "tzdata/version.json"

	GeoDataURLTemplate        = "https://github.com/evansiroky/timezone-boundary-builder/releases/download/%s/timezones-with-oceans.geojson.zip"
	GeoDataReleaseURLTemplate = "https://github.com/evansiroky/timezone-boundary-builder/releases/tag/%s"
)
View Source
const (
	Latitude  = "lat"
	Longitude = "lon"
)

constant valuses for lat / lon

Variables

View Source
var (
	ErrorVersionFileNotFound  = errors.New("release version file not found")
	ErrorVersionFileInvalid   = errors.New("release version file invalid")
	ErrorDatabaseFileNotFound = errors.New("database file not found")
	ErrorDatabaseFileInvalid  = errors.New("database file invalid")
)

Functions

func Defaults

func Defaults()

Defaults configure defaults

func Validate

func Validate(_ *ConfigSchema) (err []error)

Validate a configuration

Types

type ConfigSchema

type ConfigSchema struct {
	Tz             TzSchema  `mapstructure:"tz"`
	Web            WebSchema `mapstructure:"web"`
	RuntimeVersion string    `mapstructure:"-"`
}

ConfigSchema main configuration for the news room

var Settings ConfigSchema

Settings general settings

type Server

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

func NewServer

func NewServer(config ConfigSchema) (*Server, error)

func (*Server) Start

func (server *Server) Start() error

func (*Server) Teardown

func (server *Server) Teardown() (err error)

type TzRelease

type TzRelease struct {
	Version    string `json:"version"`
	URL        string `json:"url"`
	GeoDataURL string `json:"geo_data_url"`
}

func NewTzRelease

func NewTzRelease(version string) TzRelease

type TzSchema

type TzSchema struct {
	DatabaseName string `mapstructure:"database_name"`
	VersionFile  string `mapstructure:"version_file"`
}

TzSchema configuration

type WebSchema

type WebSchema struct {
	ListenAddress      string `mapstructure:"listen_address,omitempty"`
	AuthTokenValue     string `mapstructure:"auth_token_value,omitempty"`
	AuthTokenParamName string `mapstructure:"auth_token_param_name,omitempty"`
}

WebSchema configuration

Jump to

Keyboard shortcuts

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