messageHelpers

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Overview

Package messageHelpers defines shared message types used between services and application components.

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"`
	Source    string           `json:"Source"`
}

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"`
	Locale       string      `json:"Locale"`
	Spare1       string      `json:"Spare1"`
	Spare2       string      `json:"Spare2"`
}

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"`
	Locale   string `json:"Locale"`
	Theme    string `json:"Theme"`
	Timezone string `json:"Timezone"`
	Role     string `json:"Role"`
	Spare0   string `json:"Spare0"`
	Spare1   string `json:"Spare1"`
	Spare2   string `json:"Spare2"`
}

func (*UserMessage) Request added in v1.2.56

func (m *UserMessage) Request(key, code, source, locale, theme, timezone, role 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