exampleproto

package
v0.0.0-...-0cb89a8 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Negotiator

func Negotiator(min, max int) sockerball.Negotiator

Types

type CompressingCodec

type CompressingCodec struct{}

func (CompressingCodec) Decode

func (p CompressingCodec) Decode(in []byte, mapper sockerball.Mapper, decData *sockerball.ProtoData) (env sockerball.Envelope, rerr error)

func (CompressingCodec) Encode

func (p CompressingCodec) Encode(env sockerball.Envelope, into []byte, encData *sockerball.ProtoData) (extended []byte, rerr error)

type JSONEnvelope

type JSONEnvelope struct {
	ID      sockerball.MessageID
	ReplyTo sockerball.MessageID
	Kind    int
	Message json.RawMessage
}

type Mapper

type Mapper struct{}

func (Mapper) Message

func (m Mapper) Message(kind int) (sockerball.Message, error)

func (Mapper) MessageKind

func (m Mapper) MessageKind(msg sockerball.Message) (int, error)

type OK

type OK struct{}

type Proto

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

func (Proto) Codec

func (p Proto) Codec() sockerball.Codec

func (Proto) Mapper

func (p Proto) Mapper() sockerball.Mapper

func (Proto) MessageLimit

func (p Proto) MessageLimit() int

func (Proto) ProtocolName

func (p Proto) ProtocolName() string

func (Proto) Version

func (p Proto) Version() int

type ServerHandler

type ServerHandler struct{}

func (ServerHandler) HandleRequest

func (h ServerHandler) HandleRequest(ctx context.Context, in sockerball.IncomingRequest) (rs sockerball.Message, rerr error)

type SimpleCodec

type SimpleCodec struct{}

func (SimpleCodec) Decode

func (p SimpleCodec) Decode(in []byte, mapper sockerball.Mapper, decdata *sockerball.ProtoData) (env sockerball.Envelope, rerr error)

func (SimpleCodec) Encode

func (p SimpleCodec) Encode(env sockerball.Envelope, into []byte, encdata *sockerball.ProtoData) (extended []byte, rerr error)

type Spammer

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

func (*Spammer) Dialer

func (sp *Spammer) Dialer(neg sockerball.Negotiator) sockerball.Dialer

func (*Spammer) Flags

func (sp *Spammer) Flags(fs *cmdy.FlagSet)

func (*Spammer) Spam

func (sp *Spammer) Spam(ctx cmdy.Context, handler sockerball.Handler, clientCb spammerClientCb) error

type TestCommand

type TestCommand struct{}

type TestRequest

type TestRequest struct {
	Foo string
}

type TestResponse

type TestResponse struct {
	Bar string
}

Jump to

Keyboard shortcuts

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