messages

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRequestType = fmt.Errorf("invalid request type")

Functions

func ToRPCEnvelope

func ToRPCEnvelope(msg Message) (*proto.Envelope, error)

Types

type AnswerOfferRequest

type AnswerOfferRequest struct {
	SessionID string
	Answer    string
}

func (*AnswerOfferRequest) Type

func (a *AnswerOfferRequest) Type() string

type AnswerOfferResponse

type AnswerOfferResponse struct {
	SessionID string
	Error     string
}

func (*AnswerOfferResponse) Type

func (a *AnswerOfferResponse) Type() string

type BasicAuth

type BasicAuth struct {
	UsernameHash []byte
	PasswordHash []byte
}

type ClientSession

type ClientSession struct {
	Request  *HTTPRequest  `json:",omitempty"`
	Response *HTTPResponse `json:",omitempty"`
	File     *File         `json:",omitempty"`
	Error    string        `json:",omitempty"`
}

type File

type File struct {
	Name              string        `json:",omitempty"`
	Path              string        `json:",omitempty"`
	MIME              string        `json:",omitempty"`
	Size              int64         `json:",omitempty"`
	TransferSize      int64         `json:",omitempty"`
	TransferStartTime time.Time     `json:",omitempty"`
	TransferEndTime   time.Time     `json:",omitempty"`
	TransferDuration  time.Duration `json:",omitempty"`
	TransferRate      int64         `json:",omitempty"`
}

func FileFromEvent

func FileFromEvent(f *events.File) *File

type FinishedSessionRequest

type FinishedSessionRequest struct {
	SessionID string
	Error     string
}

sent from the oneshot server to the signalling server when a session has ended

func (*FinishedSessionRequest) Type

func (f *FinishedSessionRequest) Type() string

type FinishedSessionResponse

type FinishedSessionResponse struct {
	SessionID string
	Error     string
}

sent from the signalling server to the oneshot server when it has received the FinishedSessionRequest

func (*FinishedSessionResponse) Type

func (f *FinishedSessionResponse) Type() string

type GetOfferRequest

type GetOfferRequest struct {
	SessionID     string
	Configuration *webrtc.Configuration `json:",omitempty"`
}

sent from the signalling server to the oneshot server when a new session has been request by a client

func (*GetOfferRequest) Type

func (g *GetOfferRequest) Type() string

type GetOfferResponse

type GetOfferResponse struct {
	SessionID string
	Offer     string
}

sent from the oneshot server to the signalling server when it has crafted an offer for the client requesting a session

func (*GetOfferResponse) Type

func (g *GetOfferResponse) Type() string

type GotAnswerRequest

type GotAnswerRequest struct {
	SessionID string
	Answer    string
}

sent from the signalling server to the oneshot server when a client has answered the offer

func (*GotAnswerRequest) Type

func (g *GotAnswerRequest) Type() string

type GotAnswerResponse

type GotAnswerResponse struct {
	SessionID string
	Error     string
}

sent from the oneshot server to the signalling server when it has accepted the answer and started the session

func (*GotAnswerResponse) Type

func (g *GotAnswerResponse) Type() string

type HTTPRequest

type HTTPRequest struct {
	Method     string              `json:",omitempty"`
	RequestURI string              `json:",omitempty"`
	Path       string              `json:",omitempty"`
	Query      map[string][]string `json:",omitempty"`
	Protocol   string              `json:",omitempty"`
	Header     map[string][]string `json:",omitempty"`
	Host       string              `json:",omitempty"`
	Trailer    map[string][]string `json:",omitempty"`
	RemoteAddr string              `json:",omitempty"`
}

func HTTPRequestFromEvent

func HTTPRequestFromEvent(r *events.HTTPRequest) *HTTPRequest

type HTTPResponse

type HTTPResponse struct {
	StatusCode int                 `json:",omitempty"`
	Header     map[string][]string `json:",omitempty"`
}

func HTTPResponseFromEvent

func HTTPResponseFromEvent(r *events.HTTPResponse) *HTTPResponse

type Handshake

type Handshake struct {
	ID          string
	VersionInfo VersionInfo
	Error       string
}

func (*Handshake) Type

func (h *Handshake) Type() string

type Message

type Message interface {
	Type() string
}

func FromRPCEnvelope

func FromRPCEnvelope(env *proto.Envelope) (Message, error)

func Unmarshal

func Unmarshal(typeName string, data []byte) (Message, error)

type Ping

type Ping struct{}

func (*Ping) Type

func (p *Ping) Type() string

type Report

type Report struct {
	Success  *ClientSession   `json:",omitempty"`
	Attempts []*ClientSession `json:",omitempty"`
}

func (*Report) Type

func (r *Report) Type() string

type ServerArrivalRequest

type ServerArrivalRequest struct {
	BasicAuth             *BasicAuth
	URL                   *SessionURLRequest
	Redirect              string
	RedirectOnly          bool
	IsUsingPortMapping    bool
	TTL                   time.Duration
	Hostname              string
	Cmd                   string
	PreviouslyAssignedURL string
}

sent from the oneshot server to the signalling server after VersionInfo has been exchanged

func (*ServerArrivalRequest) Type

func (a *ServerArrivalRequest) Type() string

type ServerArrivalResponse

type ServerArrivalResponse struct {
	AssignedURL   string
	AcceptsReport bool
	Error         string
}

sent from the signalling server to the oneshot server when it first connects in response to an ArrivalRequest

func (*ServerArrivalResponse) Type

func (a *ServerArrivalResponse) Type() string

type SessionURLRequest

type SessionURLRequest struct {
	URL      string
	Required bool
}

type UpdatePingRateRequest

type UpdatePingRateRequest struct {
	Period time.Duration
}

func (*UpdatePingRateRequest) Type

func (u *UpdatePingRateRequest) Type() string

type VersionInfo

type VersionInfo struct {
	APIVersion string
	Version    string
}

Jump to

Keyboard shortcuts

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