http

package
v0.0.0-...-eff70b3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package http is a generated protocol buffer package.

It is generated from these files:

github.com/google/cloudprober/servers/http/config.proto

It has these top-level messages:

ServerConf

Package http implements an HTTP server that simply returns 'ok' for any URL and sends stats on a string channel. This is used by cloudprober to act as the backend for the HTTP based probes.

Index

Constants

View Source
const Default_ServerConf_IdleTimeoutMs int32 = 60000
View Source
const Default_ServerConf_Port int32 = 3141
View Source
const Default_ServerConf_ReadTimeoutMs int32 = 10000
View Source
const Default_ServerConf_WriteTimeoutMs int32 = 10000
View Source
const OK = "ok"

OK a string returned as successful indication by "/", and "/healthcheck".

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server implements a basic single-threaded, fast response web server.

func New

func New(initCtx context.Context, c *ServerConf, l *logger.Logger) (*Server, error)

New returns a Server.

func (*Server) Start

func (s *Server) Start(ctx context.Context, dataChan chan<- *metrics.EventMetrics) error

Start starts a simple HTTP server on a given port. This function returns only if there is an error.

type ServerConf

type ServerConf struct {
	Port *int32 `protobuf:"varint,1,opt,name=port,def=3141" json:"port,omitempty"`
	// Maximum duration for reading the entire request, including the body.
	ReadTimeoutMs *int32 `protobuf:"varint,2,opt,name=read_timeout_ms,json=readTimeoutMs,def=10000" json:"read_timeout_ms,omitempty"`
	// Maximum duration before timing out writes of the response.
	WriteTimeoutMs *int32 `protobuf:"varint,3,opt,name=write_timeout_ms,json=writeTimeoutMs,def=10000" json:"write_timeout_ms,omitempty"`
	// Maximum amount of time to wait for the next request when keep-alives are
	// enabled.
	IdleTimeoutMs    *int32 `protobuf:"varint,4,opt,name=idle_timeout_ms,json=idleTimeoutMs,def=60000" json:"idle_timeout_ms,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func (*ServerConf) Descriptor

func (*ServerConf) Descriptor() ([]byte, []int)

func (*ServerConf) GetIdleTimeoutMs

func (m *ServerConf) GetIdleTimeoutMs() int32

func (*ServerConf) GetPort

func (m *ServerConf) GetPort() int32

func (*ServerConf) GetReadTimeoutMs

func (m *ServerConf) GetReadTimeoutMs() int32

func (*ServerConf) GetWriteTimeoutMs

func (m *ServerConf) GetWriteTimeoutMs() int32

func (*ServerConf) ProtoMessage

func (*ServerConf) ProtoMessage()

func (*ServerConf) Reset

func (m *ServerConf) Reset()

func (*ServerConf) String

func (m *ServerConf) String() string

Jump to

Keyboard shortcuts

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