server

package
v0.0.0-...-20094f8 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(w http.ResponseWriter, r *http.Request, code int, errors ...string)

ErrorHandler for errors. Use code = -1 to bypass writing header or trying to set Content-Type. Useful when headers are already sent.

func Start

func Start(ctx context.Context, params Params) error

Start "kubectl apply" RESTful server

Types

type ApplyRequestBody

type ApplyRequestBody struct {
	Command string                        `json:"command,omitempty"`
	Files   map[string]decoding.FileValue `json:"files,omitempty"`
	Flags   map[string]decoding.FlagValue `json:"flags,omitempty"`
}

ApplyRequestBody for the apply endpoint.

func (*ApplyRequestBody) FilesMap

func (a *ApplyRequestBody) FilesMap() map[string][]byte

FilesMap gets the files on a map[string]string.

func (*ApplyRequestBody) FlagsMap

func (a *ApplyRequestBody) FlagsMap() map[string]string

FlagsMap gets the flags on a map[string]string.

type Params

type Params struct {
	Address string

	ExposeDebug bool
}

Params of the service

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server for handling requests

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, params Params) error

Serve handlers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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