standalone

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunApp

func RunApp(version string, args []string) error

Types

type AuthHandler

type AuthHandler interface {
	Auth(next http.HandlerFunc) http.HandlerFunc
}

type Config

type Config struct {
	URL     string
	Version string
	*gateway.Config
	Endpoint endpoint.Config
	Info     openapi3.Info
}

Config defines standalone app config

func NewConfigFromURL

func NewConfigFromURL(ctx context.Context, URL string) (*Config, error)

func (*Config) Init

func (c *Config) Init()

Init initialises config

func (*Config) Validate

func (c *Config) Validate() error

Validate validates config

type Options

type Options struct {
	ConfigURL string `short:"c" long:"cfg" description:"config URIPrefix"`
	Version   bool   `short:"v" long:"version" description:"Version"`
}

type Server

type Server struct {
	http.Server
	Service *gateway.Service
}

func New

func New(config *Config) (*Server, error)

func NewWithAuth

func NewWithAuth(config *Config, auth AuthHandler) (*Server, error)

func NewWithURL

func NewWithURL(configURL, version string) (*Server, error)

NewWithURL create service with config URL

func (*Server) Routes added in v0.2.1

func (r *Server) Routes() []*router.Route

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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