phx

package
v0.0.0-...-52ea55a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	JoinRef *string // nullable
	MsgRef  *string // nullable
	Topic   string
	Event   string
	Payload json.RawMessage
}

func NewDiff

func NewDiff(joinRef *string, topic string, diff []byte) *Diff

func (*Diff) JSON

func (d *Diff) JSON() ([]byte, error)

func (*Diff) MarshalJSON

func (d *Diff) MarshalJSON() ([]byte, error)

type Error

type Error struct {
	JoinRef string
	MsgRef  string
	Topic   string
}

func NewError

func NewError(joinRef string, msgRef string, topic string) *Error

func (*Error) MarshalJSON

func (e *Error) MarshalJSON() ([]byte, error)

type Heartbeat

type Heartbeat struct {
	Reply
	Payload
}

type Msg

type Msg struct {
	JoinRef string // or nil
	MsgRef  string
	Topic   string
	Event   string
	Payload map[string]any
}

func Parse

func Parse(msg []byte) (*Msg, error)
type Nav struct {
	JoinRef *string // nullable
	MsgRef  *string // nullable
	Topic   string
	Event   string
	Payload NavPayload
}

func NewNav

func NewNav(topic, event string, p NavPayload) *Nav
func (n *Nav) JSON() ([]byte, error)
func (n *Nav) MarshalJSON() ([]byte, error)
type NavPayload struct {
	To   string `json:"to,omitempty"`
	Kind string `json:"kind,omitempty"`
}

type Payload

type Payload struct {
	Response Response `json:"response"`
	Status   string   `json:"status"`
}

type Redirect

type Redirect struct {
	To string `json:"to,omitempty"`
}

type Reply

type Reply struct {
	JoinRef *string // nullable
	MsgRef  *string // nullable
	Topic   string
	Event   string
	Payload Payload
}

func NewEmptyReply

func NewEmptyReply(msg Msg) *Reply

func NewEmptyUploadReply

func NewEmptyUploadReply(up UploadMsg) *Reply

func NewHeartbeat

func NewHeartbeat(msgRef string) *Reply

func NewRedirect

func NewRedirect(msg Msg, to string) *Reply

func NewRendered

func NewRendered(msg Msg, rendered []byte) *Reply

func NewReplyDiff

func NewReplyDiff(msg Msg, diff []byte) *Reply

func NewUploadReplyDiff

func NewUploadReplyDiff(msg Msg, diff []byte, config []byte, entries []byte) *Reply

func (*Reply) JSON

func (m *Reply) JSON() ([]byte, error)

func (*Reply) MarshalJSON

func (m *Reply) MarshalJSON() ([]byte, error)

type Response

type Response struct {
	Rendered json.RawMessage `json:"rendered,omitempty"`
	Diff     json.RawMessage `json:"diff,omitempty"`
	Config   json.RawMessage `json:"config,omitempty"`
	Entries  json.RawMessage `json:"entries,omitempty"`
	Redirect json.RawMessage `json:"redirect,omitempty"`
}

type UploadMsg

type UploadMsg struct {
	JoinRef string
	MsgRef  string
	Topic   string
	Event   string
	Payload []byte
}

func (*UploadMsg) Equal

func (u *UploadMsg) Equal(v *UploadMsg) bool

func (UploadMsg) MarshalBinary

func (u UploadMsg) MarshalBinary() ([]byte, error)

func (*UploadMsg) UnmarshalBinary

func (u *UploadMsg) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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