messageHelpers

package
v1.2.59 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorityMessage added in v1.2.56

type AuthorityMessage struct {
	Key       string           `json:"Key"`
	User      UserMessage      `json:"User"`
	Behaviour BehaviourMessage `json:"Behaviour"`
	Payload   any              `json:"Payload"`
}

type BehaviourMessage added in v1.2.56

type BehaviourMessage struct {
	Key     string `json:"Key"`
	Source  string `json:"Source"`
	Payload any    `json:"Payload"`
}

func (*BehaviourMessage) Validate added in v1.2.58

func (m *BehaviourMessage) Validate(log *log.Logger) error

type DeclareMessage added in v1.2.56

type DeclareMessage struct {
	Domain    string           `json:"Domain"`
	Behaviour BehaviourMessage `json:"Behaviour"`
}

func (*DeclareMessage) Request added in v1.2.56

func (m *DeclareMessage) Request(domain string, behaviour string) DeclareMessage

func (*DeclareMessage) Response added in v1.2.56

func (m *DeclareMessage) Response(payload any) DeclareMessage

type GrantMessage added in v1.2.56

type GrantMessage struct {
	User      UserMessage      `json:"User"`
	Behaviour BehaviourMessage `json:"Behaviour"`
}

func (*GrantMessage) Request added in v1.2.56

func (m *GrantMessage) Request(user UserMessage, behaviour BehaviourMessage) GrantMessage

func (*GrantMessage) Response added in v1.2.56

func (m *GrantMessage) Response(payload any) GrantMessage

type RevokeMessage added in v1.2.56

type RevokeMessage struct {
	User      UserMessage      `json:"User"`
	Behaviour BehaviourMessage `json:"Behaviour"`
}

func (*RevokeMessage) Request added in v1.2.56

func (m *RevokeMessage) Request(user UserMessage, behaviour BehaviourMessage) RevokeMessage

func (*RevokeMessage) Response added in v1.2.56

func (m *RevokeMessage) Response(payload any) RevokeMessage

type SessionMessage

type SessionMessage struct {
	SessionID    string      `json:"SessionID"`
	Expiry       time.Time   `json:"Expiry"`
	UserKey      string      `json:"UserKey"`
	UserCode     string      `json:"UserCode"`
	SessionToken any         `json:"SessionToken"`
	User         UserMessage `json:"User"`
	Payload      any         `json:"Payload"`
}

func (*SessionMessage) Request added in v1.2.56

func (m *SessionMessage) Request(sessionID string, expiry time.Time, user UserMessage) SessionMessage

func (*SessionMessage) Response added in v1.2.56

func (m *SessionMessage) Response(payload any) SessionMessage

type TranslationMessage added in v1.2.56

type TranslationMessage struct {
	Text        string `json:"Text"`
	Locale      string `json:"Locale"`
	Origin      string `json:"Origin"`
	Translation string `json:"Translation"`
	Payload     any    `json:"Payload"`
}

func (*TranslationMessage) ReponseWithPayload added in v1.2.56

func (m *TranslationMessage) ReponseWithPayload(translation string, payload any) TranslationMessage

func (*TranslationMessage) Request added in v1.2.56

func (m *TranslationMessage) Request(text string, locale string, origin string) TranslationMessage

func (*TranslationMessage) Response added in v1.2.56

func (m *TranslationMessage) Response(translation string) TranslationMessage

type UserMessage

type UserMessage struct {
	Key     string `json:"Key"`
	Code    string `json:"Code"`
	Payload any    `json:"Payload"`
	Source  string `json:"Source"`
}

func (*UserMessage) Request added in v1.2.56

func (m *UserMessage) Request(key, code, source string) UserMessage

func (*UserMessage) Response added in v1.2.56

func (m *UserMessage) Response(payload any) UserMessage

func (*UserMessage) Validate added in v1.2.56

func (m *UserMessage) Validate(log *log.Logger) error

Jump to

Keyboard shortcuts

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