models

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const MessageTypeClientJoined string = "client_joined"
View Source
const MessageTypeClientMsgStatus string = "client_msg_status"
View Source
const MessageTypeInit string = "init"
View Source
const MessageTypeLogBulk string = "log_bulk"
View Source
const MessageTypeLogSingle string = "log_single"

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMessage

type BaseMessage struct {
	MessageType string `json:"message_type"`
}

type ClientJoined

type ClientJoined struct {
	BaseMessage
	ClientId string `json:"client_id"`
}

type ClientMsgStatus

type ClientMsgStatus struct {
	BaseMessage
	Client ClientStats `json:"client"`
	Stats  Stats       `json:"stats"`
}

type ClientStats

type ClientStats struct {
	LastDeliveredId    string `json:"last_delivered_id"`
	LastDeliveredIdIdx int    `json:"last_delivered_id_idx"`
	// number of messages the client is behind the tail
	// by tail we mean a recent message
	CountToTail int `json:"count_to_tail"`
}

type InitMessage

type InitMessage struct {
	BaseMessage
	AnalyticsEnabled bool   `json:"analyticsEnabled"`
	AuthRequired     bool   `json:"authRequired"`
	ConfigStr        string `json:"configStr"`
	ApiPrefix        string `json:"apiPrefix"`
}

type LogType

type LogType int
const MessageTypeStderr LogType = 2
const MessageTypeStdout LogType = 1

type Message

type Message struct {
	BaseMessage
	Id          string          `json:"id"`
	Mtype       LogType         `json:"log_type"`
	Content     string          `json:"content"`
	JsonContent json.RawMessage `json:"json_content"`
	IsJson      bool            `json:"is_json"`
	Ts          int64           `json:"ts"`
	Origin      *MessageOrigin  `json:"origin"`
}

type MessageBulk

type MessageBulk struct {
	BaseMessage
	Messages []Message `json:"messages"`
	Status   Stats     `json:"status"`
}

type MessageOrigin

type MessageOrigin struct {
	Port      string `json:"port"`
	File      string `json:"file"`
	ApiSource string `json:"api_source"`
}

type Stats

type Stats struct {
	MaxCount       int64     `json:"max_count"`
	Count          int       `json:"msg_count"`
	FirstMessageAt time.Time `json:"first_message_at"`
	LastMessageAt  time.Time `json:"last_message_at"`
}

Jump to

Keyboard shortcuts

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