udp

package
v0.0.0-...-b28dce8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package udp is a generated protocol buffer package.

It is generated from these files:

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

It has these top-level messages:

ServerConf

Package udp implements a UDP server. It listens on a given port and echos whatever it receives. This is used for the UDP probe.

Index

Constants

This section is empty.

Variables

View Source
var ServerConf_Type_name = map[int32]string{
	0: "ECHO",
	1: "DISCARD",
}
View Source
var ServerConf_Type_value = map[string]int32{
	"ECHO":    0,
	"DISCARD": 1,
}

Functions

func ListenAndServe

func ListenAndServe(ctx context.Context, c *ServerConf, l *logger.Logger) error

ListenAndServe launches an UDP echo server listening on the configured port. This function returns only in case of an error.

Types

type ServerConf

type ServerConf struct {
	Port             *int32           `protobuf:"varint,1,req,name=port" json:"port,omitempty"`
	Type             *ServerConf_Type `protobuf:"varint,2,req,name=type,enum=cloudprober.servers.udp.ServerConf_Type" json:"type,omitempty"`
	XXX_unrecognized []byte           `json:"-"`
}

func (*ServerConf) Descriptor

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

func (*ServerConf) GetPort

func (m *ServerConf) GetPort() int32

func (*ServerConf) GetType

func (m *ServerConf) GetType() ServerConf_Type

func (*ServerConf) ProtoMessage

func (*ServerConf) ProtoMessage()

func (*ServerConf) Reset

func (m *ServerConf) Reset()

func (*ServerConf) String

func (m *ServerConf) String() string

type ServerConf_Type

type ServerConf_Type int32
const (
	// Echos the incoming packet back.
	// Note that UDP echo server limits reads to 4098 bytes. For messages longer
	// than 4098 bytes it won't work as expected.
	ServerConf_ECHO ServerConf_Type = 0
	// Discard the incoming packet. Return nothing.
	ServerConf_DISCARD ServerConf_Type = 1
)

func (ServerConf_Type) Enum

func (x ServerConf_Type) Enum() *ServerConf_Type

func (ServerConf_Type) EnumDescriptor

func (ServerConf_Type) EnumDescriptor() ([]byte, []int)

func (ServerConf_Type) String

func (x ServerConf_Type) String() string

func (*ServerConf_Type) UnmarshalJSON

func (x *ServerConf_Type) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
This binary implements a stand-alone UDP server using the cloudprober/servers/udp/udp package.
This binary implements a stand-alone UDP server using the cloudprober/servers/udp/udp package.

Jump to

Keyboard shortcuts

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