rest

package
v0.0.0-...-ae3da92 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewYamlReaderWriter

func NewYamlReaderWriter(contentType string) restful.EntityReaderWriter

NewYamlReaderWriter creates new instance.

Types

type Server

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

Server is a HTTP server.

func NewServer

func NewServer() *Server

NewServer creates new instance of server.

func (*Server) Init

func (s *Server) Init(stop chan int)

Init initializes server.

func (*Server) Restart

func (s *Server) Restart()

Restart performs server restart by stopping it and the by starting again.

func (*Server) Start

func (s *Server) Start()

Start creates RESTful container and starts accepting HTTP requests.

func (*Server) Stop

func (s *Server) Stop()

Stop stops the server.

type YamlReaderWriter

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

YamlReaderWriter implements EntityReaderWriter for YAML objects to be used by restful.

func (YamlReaderWriter) Read

func (e YamlReaderWriter) Read(req *restful.Request, v interface{}) error

Read a serialized version of the value from the request. The Request may have a decompressing reader. Depends on Content-Encoding.

func (YamlReaderWriter) Write

func (e YamlReaderWriter) Write(resp *restful.Response, status int, v interface{}) error

Write a serialized version of the value on the response. The Response may have a compressing writer. Depends on Accept-Encoding. status should be a valid Http Status code

Jump to

Keyboard shortcuts

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