apiserver

package
v0.0.4-amaheshtst Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RoutePathNodeBootstrapping the route path to get node bootstrapping data.
	RoutePathNodeBootstrapData string = "/getnodebootstrapdata"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServer

type APIServer struct {
	Options *Options
}

APIServer contains the connections details required to run the api

func NewAPIServer

func NewAPIServer(o *Options) (*APIServer, error)

NewAPIServer creates an APIServer object with defaults

func (*APIServer) GetNodeBootstrapData

func (api *APIServer) GetNodeBootstrapData(w http.ResponseWriter, r *http.Request)

GetNodeBootstrapConfig endpoint for getting node bootstrapping data.

func (*APIServer) ListenAndServe

func (api *APIServer) ListenAndServe(ctx context.Context) error

ListenAndServe wraps http.Server and provides context-based cancelation.

func (*APIServer) NewRouter

func (api *APIServer) NewRouter(ctx context.Context) *mux.Router

NewRouter returns a new router with defaults

type Options

type Options struct {
	Addr string
}

Options holds the options for the api server

type Result added in v0.2022722.0

type Result struct {
	Message string
	Error   error
}

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route the route specifics

type Routes

type Routes []Route

Routes list of routes to be added to the server

Jump to

Keyboard shortcuts

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