core

package
v0.0.0-...-da6bd8b Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StreamMaxLen = 4096
	StreamExpire = time.Hour * 24
	StreamBlock  = time.Millisecond * 500
)

Variables

This section is empty.

Functions

func GetMessage

func GetMessage(message *pb.Message) (map[string]interface{}, error)

func GetStreamId

func GetStreamId(channel uint32) string

func ParseMessage

func ParseMessage(data map[string]interface{}) (*pb.Message, error)

Types

type Config

type Config struct {
	Server *server `json:"server,omitempty"`
	Redis  *redis  `json:"redis,omitempty"`
	Queue  *queue  `json:"queue,omitempty"`
}

func NewConfig

func NewConfig(ctx context.Context, path string) (*Config, error)

type Message

type Message struct {
	Task  string `json:"task"`
	Type  uint32 `json:"type"`
	Body  string `json:"body"`
	ReqTs int64  `json:"req_ts"`
	InTs  int64  `json:"in_ts"`
	OutTs int64  `json:"out_ts"`
}

Jump to

Keyboard shortcuts

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