service

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2017 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

Package service is a generated protocol buffer package.

It is generated from these files:

service/service.proto

It has these top-level messages:

Meta
AllActions
Targets
SlotRange
Slot
Slots
ErrorMessage

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDataLength the data length wrong
	ErrDataLength = errors.New("read data length wrong")
)

Functions

func GenerateHeaderBuf

func GenerateHeaderBuf(length uint16, route uint8) []byte

GenerateHeaderBuf to generate a header buf

func ReadOne

func ReadOne(r io.Reader) ([]byte, uint8, error)

ReadOne to read header containing data count and route info

func Start

func Start(port uint16, dbFolder string)

Start service

func WriteErrorMessage

func WriteErrorMessage(err error, w io.Writer)

WriteErrorMessage to write a message to writer

Types

type AllActions

type AllActions struct {
	Actions []*AllActions_Act `protobuf:"bytes,1,rep,name=actions" json:"actions,omitempty"`
}

func (*AllActions) Descriptor

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

func (*AllActions) GetActions

func (m *AllActions) GetActions() []*AllActions_Act

func (*AllActions) ProtoMessage

func (*AllActions) ProtoMessage()

func (*AllActions) Reset

func (m *AllActions) Reset()

func (*AllActions) String

func (m *AllActions) String() string

type AllActions_Act

type AllActions_Act struct {
	Target string `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"`
	Start  uint32 `protobuf:"varint,2,opt,name=start" json:"start,omitempty"`
	Last   uint32 `protobuf:"varint,3,opt,name=last" json:"last,omitempty"`
}

func (*AllActions_Act) Descriptor

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

func (*AllActions_Act) GetLast

func (m *AllActions_Act) GetLast() uint32

func (*AllActions_Act) GetStart

func (m *AllActions_Act) GetStart() uint32

func (*AllActions_Act) GetTarget

func (m *AllActions_Act) GetTarget() string

func (*AllActions_Act) ProtoMessage

func (*AllActions_Act) ProtoMessage()

func (*AllActions_Act) Reset

func (m *AllActions_Act) Reset()

func (*AllActions_Act) String

func (m *AllActions_Act) String() string

type ErrorMessage

type ErrorMessage struct {
	Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}

func (*ErrorMessage) Descriptor

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

func (*ErrorMessage) GetMessage

func (m *ErrorMessage) GetMessage() string

func (*ErrorMessage) ProtoMessage

func (*ErrorMessage) ProtoMessage()

func (*ErrorMessage) Reset

func (m *ErrorMessage) Reset()

func (*ErrorMessage) String

func (m *ErrorMessage) String() string

type Meta

type Meta struct {
	Version    uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
	Tag        string `protobuf:"bytes,2,opt,name=tag" json:"tag,omitempty"`
	CreateAt   uint32 `protobuf:"varint,3,opt,name=create_at,json=createAt" json:"create_at,omitempty"`
	Host       string `protobuf:"bytes,4,opt,name=host" json:"host,omitempty"`
	Username   string `protobuf:"bytes,5,opt,name=username" json:"username,omitempty"`
	Arch       string `protobuf:"bytes,6,opt,name=arch" json:"arch,omitempty"`
	Os         string `protobuf:"bytes,7,opt,name=os" json:"os,omitempty"`
	ZoneOffset int32  `protobuf:"varint,8,opt,name=zone_offset,json=zoneOffset" json:"zone_offset,omitempty"`
}

func (*Meta) Descriptor

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

func (*Meta) GetArch

func (m *Meta) GetArch() string

func (*Meta) GetCreateAt

func (m *Meta) GetCreateAt() uint32

func (*Meta) GetHost

func (m *Meta) GetHost() string

func (*Meta) GetOs

func (m *Meta) GetOs() string

func (*Meta) GetTag

func (m *Meta) GetTag() string

func (*Meta) GetUsername

func (m *Meta) GetUsername() string

func (*Meta) GetVersion

func (m *Meta) GetVersion() uint32

func (*Meta) GetZoneOffset

func (m *Meta) GetZoneOffset() int32

func (*Meta) ProtoMessage

func (*Meta) ProtoMessage()

func (*Meta) Reset

func (m *Meta) Reset()

func (*Meta) String

func (m *Meta) String() string

type RouteFunc

type RouteFunc func([]byte, io.Writer)

RouteFunc to route handlers

type Slot

type Slot struct {
	Start uint32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
	Slot  uint32 `protobuf:"varint,2,opt,name=slot" json:"slot,omitempty"`
}

func (*Slot) Descriptor

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

func (*Slot) GetSlot

func (m *Slot) GetSlot() uint32

func (*Slot) GetStart

func (m *Slot) GetStart() uint32

func (*Slot) ProtoMessage

func (*Slot) ProtoMessage()

func (*Slot) Reset

func (m *Slot) Reset()

func (*Slot) String

func (m *Slot) String() string

type SlotRange

type SlotRange struct {
	Target string `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"`
	Start  uint32 `protobuf:"varint,2,opt,name=start" json:"start,omitempty"`
	End    uint32 `protobuf:"varint,3,opt,name=end" json:"end,omitempty"`
}

func (*SlotRange) Descriptor

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

func (*SlotRange) GetEnd

func (m *SlotRange) GetEnd() uint32

func (*SlotRange) GetStart

func (m *SlotRange) GetStart() uint32

func (*SlotRange) GetTarget

func (m *SlotRange) GetTarget() string

func (*SlotRange) ProtoMessage

func (*SlotRange) ProtoMessage()

func (*SlotRange) Reset

func (m *SlotRange) Reset()

func (*SlotRange) String

func (m *SlotRange) String() string

type Slots

type Slots struct {
	Slots []*Slot `protobuf:"bytes,1,rep,name=slots" json:"slots,omitempty"`
}

func (*Slots) Descriptor

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

func (*Slots) GetSlots

func (m *Slots) GetSlots() []*Slot

func (*Slots) ProtoMessage

func (*Slots) ProtoMessage()

func (*Slots) Reset

func (m *Slots) Reset()

func (*Slots) String

func (m *Slots) String() string

type TCPServer

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

TCPServer to define a TCP server

func NewTCPServer

func NewTCPServer(port uint16, router map[uint8]RouteFunc) *TCPServer

NewTCPServer to create a TCP server instance

func (*TCPServer) Start

func (s *TCPServer) Start() error

Start the server

func (*TCPServer) Stop

func (s *TCPServer) Stop() error

Stop the server

type Targets

type Targets struct {
	Target []string `protobuf:"bytes,1,rep,name=target" json:"target,omitempty"`
}

func (*Targets) Descriptor

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

func (*Targets) GetTarget

func (m *Targets) GetTarget() []string

func (*Targets) ProtoMessage

func (*Targets) ProtoMessage()

func (*Targets) Reset

func (m *Targets) Reset()

func (*Targets) String

func (m *Targets) String() string

type UDPServer

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

UDPServer to define a UDP server

func NewUDPServer

func NewUDPServer(port uint16, router map[uint8]RouteFunc) *UDPServer

NewUDPServer to create a server instance

func (*UDPServer) Start

func (s *UDPServer) Start()

Start the UDP server

Jump to

Keyboard shortcuts

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