endpoints

package
v0.0.0-...-70eb549 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VERSION string

go generate does not work in subdirectories. Beautious.

Functions

func Bgp

func Bgp(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func CheckAccess

func CheckAccess(req *http.Request) error

func CheckUseCache

func CheckUseCache(req *http.Request) bool

func Endpoint

func Endpoint(wrapped endpoint) httprouter.Handle

func PeerRoutes

func PeerRoutes(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func PipeRoutesFiltered

func PipeRoutesFiltered(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func PipeRoutesFilteredCount

func PipeRoutesFilteredCount(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func ProtoCount

func ProtoCount(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func ProtoPrimaryCount

func ProtoPrimaryCount(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func ProtoRoutes

func ProtoRoutes(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func Protocols

func Protocols(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func ProtocolsShort

func ProtocolsShort(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func RouteNet

func RouteNet(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func RouteNetMask

func RouteNetMask(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func RouteNetMaskTable

func RouteNetMaskTable(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func RouteNetTable

func RouteNetTable(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func RoutesExport

func RoutesExport(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func RoutesFiltered

func RoutesFiltered(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func RoutesNoExport

func RoutesNoExport(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func RoutesPrefixed

func RoutesPrefixed(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func Status

func Status(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func SymbolProtocols

func SymbolProtocols(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func SymbolTables

func SymbolTables(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func Symbols

func Symbols(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func TableAndPeerRoutes

func TableAndPeerRoutes(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func TableCount

func TableCount(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func TableRoutes

func TableRoutes(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func TableRoutesFiltered

func TableRoutesFiltered(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool)

func ValidateCharset

func ValidateCharset(value string, alphabet string) error

func ValidateLength

func ValidateLength(value string, maxLength int) error

Check if the value is not longer than a given length

func ValidateLengthAndCharset

func ValidateLengthAndCharset(value string, maxLength int, alphabet string) (string, error)

func ValidateNetMaskParam

func ValidateNetMaskParam(value string) (string, error)

func ValidatePrefixParam

func ValidatePrefixParam(value string) (string, error)

func ValidateProtocolParam

func ValidateProtocolParam(value string) (string, error)

func Version

func Version(version string) httprouter.Handle

Types

type APIInfo

type APIInfo struct {
	Version         string
	ResultFromCache bool        `json:"result_from_cache"`
	CacheStatus     CacheStatus `json:"cache_status"`
}

func GetApiInfo

func GetApiInfo(res *bird.Parsed, from_cache bool) *APIInfo

type CacheStatus

type CacheStatus struct {
	CachedAt TimeInfo `json:"cached_at"`
}

type ServerConfig

type ServerConfig struct {
	AllowFrom      []string `toml:"allow_from"`
	ModulesEnabled []string `toml:"modules_enabled"`
	AllowUncached  bool     `toml:"allow_uncached"`

	EnableTLS bool   `toml:"enable_tls"`
	Crt       string `toml:"crt"`
	Key       string `toml:"key"`
}

Endpoints / Server configuration

var Conf ServerConfig

type TimeInfo

type TimeInfo struct {
	Date         time.Time `json:"date"`
	TimezoneType string    `json:"timezone_type"`
	Timezone     string    `json:"timezone"`
}

Jump to

Keyboard shortcuts

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