standalone

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 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(ctx context.Context)

init initialises config

func (*Config) Validate

func (c *Config) Validate() error

Validate validates config

type Option added in v0.8.0

type Option func(*Options)

Option represents standalone option

func WithConfig added in v0.8.0

func WithConfig(config *Config) Option

func WithConfigURL added in v0.8.0

func WithConfigURL(configURL string) Option

func WithOptions added in v0.8.0

func WithOptions(options ...gateway.Option) Option

WithOptions sets options

func WithUseSingleton added in v0.8.0

func WithUseSingleton(useSingleton bool) Option

WithUseSingleton sets a singleton

type Options

type Options struct {
	ConfigURL string `short:"c" long:"cfg" description:"config URIPrefix"`
	Version   bool   `short:"v" long:"version" description:"Version"`
	// contains filtered or unexported fields
}

Options represents standalone options

func NewOptions added in v0.8.0

func NewOptions(ctx context.Context, opts ...Option) (*Options, error)

func (*Options) UseSingleton added in v0.8.0

func (o *Options) UseSingleton() bool

type Server

type Server struct {
	http.Server
	Service *gateway.Service
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, opts ...Option) (*Server, error)

func NewWithURL

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

NewWithURL create service with config URL

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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