dom

package
v0.0.0-...-748ecea Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserStatusToAPI

func UserStatusToAPI(status UserStatus) user_status_pb.StatusKind

UserStatusToAPI converts user status from protobuf.

Types

type AcknowledgeKind

type AcknowledgeKind uint8

AcknowledgeKind represents kind of acknowledgment.

const (
	AcknowledgeKindAck AcknowledgeKind
	AcknowledgeKindNack
)

func (AcknowledgeKind) String

func (i AcknowledgeKind) String() string

type Event

type Event[T any] struct {
	// contains filtered or unexported fields
}

Event contains event message information.

func NewEvent

func NewEvent[T any](
	id uuid.UUID,
	ack chan AcknowledgeKind,
	body T,
) *Event[T]

NewEvent build and returns new event from message broker.

func (*Event[T]) Ack

func (e *Event[T]) Ack(ctx context.Context)

func (*Event[T]) Body

func (e *Event[T]) Body() T

func (*Event[T]) ID

func (e *Event[T]) ID() uuid.UUID

func (*Event[T]) Nack

func (e *Event[T]) Nack(ctx context.Context)

type Origin

type Origin struct {
	IP        net.IP
	UserAgent string
}

Origin information about req user.

type Session

type Session struct {
	ID     uuid.UUID
	UserID uuid.UUID
	Status UserStatus
}

Session contains main session info.

type Token

type Token struct {
	Value string
}

Token contains user's authorization token.

type UserStatus

type UserStatus uint8

UserStatus user status in service.

const (
	UserStatusFreeze UserStatus
	UserStatusDefault
	UserStatusPremium
	UserStatusSupport
	UserStatusAdmin
	UserStatusJedi
)

func UserStatusFromAPI

func UserStatusFromAPI(kind user_status_pb.StatusKind) UserStatus

UserStatusFromAPI converts user status from protobuf.

func (UserStatus) IsAdmin

func (i UserStatus) IsAdmin() bool

func (UserStatus) IsDefault

func (i UserStatus) IsDefault() bool

func (UserStatus) IsFreeze

func (i UserStatus) IsFreeze() bool

func (UserStatus) IsJedi

func (i UserStatus) IsJedi() bool

func (UserStatus) IsManager

func (i UserStatus) IsManager() bool

func (UserStatus) IsPremium

func (i UserStatus) IsPremium() bool

func (UserStatus) IsSpecialist

func (i UserStatus) IsSpecialist() bool

func (UserStatus) IsSupport

func (i UserStatus) IsSupport() bool

func (UserStatus) String

func (i UserStatus) String() string

Jump to

Keyboard shortcuts

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