upstream

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(config Config) *chi.Mux

Types

type Config

type Config struct {
	Servers []Server
}

type ConfigSchema

type ConfigSchema struct {
	Servers []ServerSchema `json:"servers"`
}

func (*ConfigSchema) CreateConfig

func (s *ConfigSchema) CreateConfig() Config

func (*ConfigSchema) Validate

func (s *ConfigSchema) Validate() error

type Duration

type Duration time.Duration

期間をそのままJSONに記述できるようにするためには、encoding/jsonの要求するインターフェースをみたす型である必要があるため

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error

type Server

type Server struct {
	ID          string
	URL         *url.URL
	MatchPrefix string
	Timeout     *Duration
}

type ServerSchema

type ServerSchema struct {
	ID          string    `json:"id"`
	URL         string    `json:"url"`
	MatchPrefix string    `json:"matchPath"`
	Timeout     *Duration `json:"timeout,omitempty"`
}

Jump to

Keyboard shortcuts

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