entities

package
v0.0.0-...-5d83258 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcast

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

func NewBroadcast

func NewBroadcast[T any]() *Broadcast[T]

func (*Broadcast[T]) Close

func (r *Broadcast[T]) Close()

func (*Broadcast[T]) Listen

func (r *Broadcast[T]) Listen(f func(T))

func (*Broadcast[T]) OnClose

func (r *Broadcast[T]) OnClose(f func())

func (*Broadcast[T]) Send

func (r *Broadcast[T]) Send(data T)

type BytesIOListener

type BytesIOListener = Broadcast[[]byte]

type Error

type Error struct {
	ErrorType string `json:"error_type"`
	Message   string `json:"message"`
	Args      any    `json:"args"`
}

func NewError

func NewError(error_type string, message string, args ...any) *Error

func (*Error) Error

func (e *Error) Error() string

type GenericResponse

type GenericResponse[T any] struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    T      `json:"data"`
}

type Response

type Response struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data"`
}

func NewDaemonErrorResponse

func NewDaemonErrorResponse(code int, message string, args ...any) *Response

func NewSuccessResponse

func NewSuccessResponse(data any) *Response

Jump to

Keyboard shortcuts

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