starter

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Serving func(router *mux.Router) error

Serving is the function which starts the server

View Source
var Shutdown func() error

Shutdown is the function which stops the server

View Source
var StopChannel = make(chan os.Signal, 1)

StopChannel is the channel which is used to stop the server

Functions

func DefaultServing

func DefaultServing(router *mux.Router) error

DefaultServing is the default server

func DefaultShutdown

func DefaultShutdown() error

DefaultShutdown is the default shutdown

func SetupRouter

func SetupRouter(variant, versionTag, configInfo string, matchStore matches.Matchstore, kvStore kvstore.Storage)

SetupRouter sets up the router with the given configuration, allows to control the server start

Types

type BasicConfiguration

type BasicConfiguration struct {
	LoglevelAPI     string `default:"INFO" split_words:"true"`
	LoglevelMock    string `default:"INFO" split_words:"true"`
	MockPort        int    `default:"8081" split_words:"true"`
	MockDir         string `default:"." split_words:"true"`
	MockFilepattern string `default:"*-mock.*" split_words:"true"`
	MatchesCapacity int    `default:"1000" split_words:"true"`
	APIPathPrefix   string `default:"/__" split_words:"true"`
	APIUsername     string `default:"mockgo" split_words:"true"`
	APIPassword     string `default:"password" split_words:"true"`
}

BasicConfiguration is the basic configuration model of the server which is defined via environment variables

var BasicConfig *BasicConfiguration

BasicConfig is the basic mock configuration

func (*BasicConfiguration) Info

func (c *BasicConfiguration) Info() string

Info returns a string with the configuration info

type RequestHandler

type RequestHandler interface {
	AddRoutes(router *mux.Router)
}

RequestHandler abstraction of a set of http handler funcs

Jump to

Keyboard shortcuts

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