types

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateResponseJson

func CreateResponseJson(data []byte, id string) string

Types

type Context

type Context struct {
	Logger  logging.Logger
	Context context.Context
	Session *common.AuthSession
	// Connection *websocket.Conn
	Mutex *sync.Mutex

	Write          func([]byte) error
	WriteJSON      func(interface{}) error
	OnDisconnectFn func() error
}

func (Context) OnDisconnect

func (c Context) OnDisconnect() error

type For

type For string
const (
	ForLogs           For = "logs"
	ForJetstreamLogs  For = "jetstram-logs"
	ForResourceUpdate For = "resource-update"
)

type Message

type Message struct {
	For  For            `json:"for"`
	Data map[string]any `json:"data"`
}

type MessageType

type MessageType string
const (
	MessageTypeError    MessageType = "error"
	MessageTypeResponse MessageType = "response"
	MessageTypeInfo     MessageType = "info"
	MessageTypeWarning  MessageType = "warning"
)

type Response

type Response[T any] struct {
	Type MessageType `json:"type"`
	For  For         `json:"for"`

	Data    T      `json:"data"`
	Message string `json:"message"`
	Id      string `json:"id"`
}

Jump to

Keyboard shortcuts

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