api

package
v0.0.0-...-3273997 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivateApi

type PrivateApi struct {
	Router  *mux.Router
	Address string
	// contains filtered or unexported fields
}

func NewPrivateApi

func NewPrivateApi(logger *logger.Logger, config *PrivateApiConfig) *PrivateApi

func (*PrivateApi) Addr

func (a *PrivateApi) Addr() string

func (*PrivateApi) Build

func (a *PrivateApi) Build() *http.Server

func (*PrivateApi) Prefix

func (a *PrivateApi) Prefix(serverName string, path string) string

func (*PrivateApi) RegisterPrivateRoutes

func (a *PrivateApi) RegisterPrivateRoutes()

func (*PrivateApi) RegisterRoutesFunc

func (a *PrivateApi) RegisterRoutesFunc(fn func(router *mux.Router))

type PrivateApiConfig

type PrivateApiConfig struct {
	Address string `envconfig:"PRIVATE_ADDRESS" default:":8081"`
}

type PublicApi

type PublicApi struct {
	*PublicApiConfig
	Router *mux.Router
}

func NewPublicApi

func NewPublicApi(config *PublicApiConfig) *PublicApi

func (*PublicApi) Addr

func (api *PublicApi) Addr() string

func (*PublicApi) Build

func (api *PublicApi) Build() *http.Server

func (*PublicApi) Prefix

func (api *PublicApi) Prefix(serverName string, path string) string

func (*PublicApi) RegisterRoutesFunc

func (api *PublicApi) RegisterRoutesFunc(fn func(router *mux.Router))

type PublicApiConfig

type PublicApiConfig struct {
	Address         string `envconfig:"PUBLIC_ADDRESS" default:":8080"`
	ApplicationSlug string `envconfig:"SLUG" default:"feed"`
}

type Registrar

type Registrar interface {
	Addr() string
	Build() *http.Server
	RegisterRoutesFunc(func(router *mux.Router))
	Prefix(serverName string, path string) string
}

Jump to

Keyboard shortcuts

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