http

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CallbackBasePath callback path
	CallbackBasePath = "/report/{node}/{executionID}"
	// CallbackBaseResultSubPath result sub path
	CallbackBaseResultSubPath = "/result"
	// CallbackBaseFileSubPath file sub path
	CallbackBaseFileSubPath = "/file"
	// CallbackBaseEventSubPath event sub path
	CallbackBaseEventSubPath = "/event"

	// FileName query parameter name
	FileName = "name"
)

Variables

This section is empty.

Functions

func GenericAPIServer

func GenericAPIServer(port int, reportPath string) manager.Runnable

GenericAPIServer prepare the generic api server

func SetupProfiling

func SetupProfiling(r *mux.Router)

SetupProfiling setup profiling

func StaticFileServer

func StaticFileServer(port int, path string) manager.Runnable

StaticFileServer prepare the static file server

Types

type Event added in v1.0.0

type Event struct {
	Waring  bool     `json:"warning"`
	Reason  string   `json:"reason" validate:"required,first_char_must_be_uppercase"`
	Message string   `json:"message,omitEmpty" validate:"required"`
	Args    []string `json:"args,omitEmpty"`
}

Event to be sent as k8s event

func (*Event) Type added in v1.0.0

func (e *Event) Type() string

func (*Event) Validate added in v1.0.0

func (e *Event) Validate() error

Validate the event

type PostServer

type PostServer struct {
	Server
	Cache         lifecycle.Cache
	ReportPath    string
	EventRecorder record.EventRecorder
	Config        *config.Config
	Client        client.Reader
}

PostServer post server

func (*PostServer) InjectCache added in v1.0.0

func (s *PostServer) InjectCache(cache lifecycle.Cache)

func (*PostServer) InjectConfig added in v1.0.0

func (s *PostServer) InjectConfig(cfg *config.Config)

func (*PostServer) InjectEventRecorder added in v1.0.0

func (s *PostServer) InjectEventRecorder(er record.EventRecorder)

func (*PostServer) InjectReader added in v1.0.0

func (s *PostServer) InjectReader(reader client.Reader)

func (*PostServer) SaveFile

func (s *PostServer) SaveFile(executionID, name string, data []byte) (string, error)

SaveFile save a received file

type Server

type Server struct {
	Port    int
	Kind    string
	Handler http.Handler
}

Server default server

func (*Server) Start

func (s *Server) Start(stop <-chan struct{}) error

Start the server

Jump to

Keyboard shortcuts

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