messages

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pack

func Pack(payload Message) ([]byte, error)

Pack serializes a message into a byte array

Types

type AuthControl

type AuthControl struct {
	Token string `msg:"token"`
}

AuthControl is sent by the client to create and authenticate a new session

func (*AuthControl) DecodeMsg added in v0.6.0

func (z *AuthControl) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (AuthControl) EncodeMsg added in v0.6.0

func (z AuthControl) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (AuthControl) MarshalMsg added in v0.6.0

func (z AuthControl) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (AuthControl) Msgsize added in v0.6.0

func (z AuthControl) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*AuthControl) UnmarshalMsg added in v0.6.0

func (z *AuthControl) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type AuthTunnel

type AuthTunnel struct {
	ClientID string `msg:"client_id"`
	Token    string `msg:"token"`
}

AuthTunnel is sent by the client to create and authenticate a tunnel connection

func (*AuthTunnel) DecodeMsg added in v0.6.0

func (z *AuthTunnel) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (AuthTunnel) EncodeMsg added in v0.6.0

func (z AuthTunnel) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (AuthTunnel) MarshalMsg added in v0.6.0

func (z AuthTunnel) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (AuthTunnel) Msgsize added in v0.6.0

func (z AuthTunnel) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*AuthTunnel) UnmarshalMsg added in v0.6.0

func (z *AuthTunnel) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Envelope

type Envelope struct {
	Type    MessageType `msg:"type"`
	Payload msgp.Raw    `msg:"payload"`
}

Envelope is a wrapper struct used to encode message types as they are serialized to JSON

func (*Envelope) DecodeMsg added in v0.6.0

func (z *Envelope) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Envelope) EncodeMsg added in v0.6.0

func (z *Envelope) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Envelope) MarshalMsg added in v0.6.0

func (z *Envelope) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Envelope) Msgsize added in v0.6.0

func (z *Envelope) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Envelope) UnmarshalMsg added in v0.6.0

func (z *Envelope) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Message

Message is a generic interface for all the messages

func Unpack

func Unpack(buffer []byte) (msg Message, err error)

Unpack deserializes byte array into a message

type MessageType added in v0.6.0

type MessageType int

MessageType is an encoding for the underlying payload

const (
	MsgUnsupported MessageType = iota
	MsgAuthControl
	MsgAuthTunnel
	MsgOpenTunnel
	MsgPing
	MsgPong
	MsgShutdown
	MsgRelease
)

definitions of message types

func (*MessageType) DecodeMsg added in v0.6.0

func (z *MessageType) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (MessageType) EncodeMsg added in v0.6.0

func (z MessageType) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (MessageType) MarshalMsg added in v0.6.0

func (z MessageType) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (MessageType) Msgsize added in v0.6.0

func (z MessageType) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*MessageType) UnmarshalMsg added in v0.6.0

func (z *MessageType) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type OpenTunnel

type OpenTunnel struct {
	ClientID string `msg:"client_id"`
}

OpenTunnel is sent by server to the client to request a new Tunnel connection

func (*OpenTunnel) DecodeMsg added in v0.6.0

func (z *OpenTunnel) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (OpenTunnel) EncodeMsg added in v0.6.0

func (z OpenTunnel) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (OpenTunnel) MarshalMsg added in v0.6.0

func (z OpenTunnel) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (OpenTunnel) Msgsize added in v0.6.0

func (z OpenTunnel) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*OpenTunnel) UnmarshalMsg added in v0.6.0

func (z *OpenTunnel) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Ping

type Ping struct{}

Ping is sent to request a Pong response and check the liveness of the connection

func (*Ping) DecodeMsg added in v0.6.0

func (z *Ping) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Ping) EncodeMsg added in v0.6.0

func (z Ping) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Ping) MarshalMsg added in v0.6.0

func (z Ping) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Ping) Msgsize added in v0.6.0

func (z Ping) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Ping) UnmarshalMsg added in v0.6.0

func (z *Ping) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Pong

type Pong struct{}

Pong is a response ot the Ping message

func (*Pong) DecodeMsg added in v0.6.0

func (z *Pong) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Pong) EncodeMsg added in v0.6.0

func (z Pong) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Pong) MarshalMsg added in v0.6.0

func (z Pong) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Pong) Msgsize added in v0.6.0

func (z Pong) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Pong) UnmarshalMsg added in v0.6.0

func (z *Pong) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Release

type Release struct {
	ID                     string    `msg:"id" redis:"id,omitempty"`
	Branch                 string    `msg:"branch" redis:"branch,omitempty"`
	Description            string    `msg:"description" redis:"description,omitempty"`
	VCSType                string    `msg:"vcs_type" redis:"vcs_type,omitempty"`
	VCSRevision            string    `msg:"vcs_revision" redis:"vcs_revision,omitempty"`
	VCSRevisionMessage     string    `msg:"vcs_revision_message" redis:"vcs_revision_message,omitempty"`
	VCSRevisionTime        time.Time `msg:"vcs_revision_time" redis:"vcs_revision_time,omitempty"`
	VCSRevisionAuthorName  string    `msg:"vcs_revision_author_name" redis:"vcs_revision_author_name,omitempty"`
	VCSRevisionAuthorEmail string    `msg:"vcs_revision_author_email" redis:"vcs_revision_author_email,omitempty"`
}

Release contains basic VCS (e.g. git) information about the running version of client server

func (*Release) DecodeMsg added in v0.6.0

func (z *Release) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Release) EncodeMsg added in v0.6.0

func (z *Release) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Release) MarshalMsg added in v0.6.0

func (z *Release) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Release) Msgsize added in v0.6.0

func (z *Release) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Release) UnmarshalMsg added in v0.6.0

func (z *Release) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Shutdown

type Shutdown struct {
	Error string `msg:"error"`
}

Shutdown is sent either by server or client to indicate that the session should be torn down

func (*Shutdown) DecodeMsg added in v0.6.0

func (z *Shutdown) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Shutdown) EncodeMsg added in v0.6.0

func (z Shutdown) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Shutdown) MarshalMsg added in v0.6.0

func (z Shutdown) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Shutdown) Msgsize added in v0.6.0

func (z Shutdown) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Shutdown) UnmarshalMsg added in v0.6.0

func (z *Shutdown) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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