standalone

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

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