models

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToRpcServer

func ConnectToRpcServer(host, port string) (*rpc.Client, error)

Types

type BrokerConfig

type BrokerConfig struct {
	Host      string
	Port      string
	Storage   StorageType
	Transport Transport
}

BrokerConfig contains information for setting up a broker server

type GetMessageRequest

type GetMessageRequest struct {
	SubscriberId string
	Topic        string
	Partition    Partition
	Timestamp    time.Time
	PublishTime  PublishTime
}

type Message

type Message struct {
	Id        string
	Topic     string
	Partition Partition
	Data      string
	Timestamp time.Time
}

Message represents the data structure of a message.

type MessageList

type MessageList []*Message

type Offset

type Offset struct {
	Topic     string
	Partition Partition
	Timestamp time.Time
}

type Partition

type Partition int
var (
	DefaultPartition Partition = 0
)

type PublishTime

type PublishTime time.Duration
const (
	LatestPublishTime        PublishTime = 0
	EarliestPublishTime      PublishTime = -1
	WithinASecondPublishTime PublishTime = PublishTime(time.Second * -1)
	WithinAnHourPublishTime  PublishTime = PublishTime(time.Hour * -1)
	WithinADayPublishTime    PublishTime = PublishTime(time.Hour * -24)
)

type PublisherConfig

type PublisherConfig struct {
	Host      string
	Port      string
	Partition Partition
	Transport Transport
}

PublisherConfig sets up connection for the publisher service

type StorageType

type StorageType string
const (
	InMemoryStorageType StorageType = "InMemory"
	RedisStorageType    StorageType = "Redis"
	DiskStorageType     StorageType = "Disk"
)

type SubscriberConfig

type SubscriberConfig struct {
	Host               string
	Port               string
	GroupId            string
	SubscriberId       *string
	MessagePublishTime PublishTime
	Partition          Partition
	Transport          Transport
}

SubscriberConfig sets up connection for the subscriber service

type SubscriberOffsets

type SubscriberOffsets map[string]Offset

type Transport

type Transport string
const (
	DefaultTransport   Transport = "RPC"
	GrpcTransport      Transport = "GRPC"
	WebSocketTransport Transport = "WebSocket"
	RedisTransport     Transport = "Redis"
)

Jump to

Keyboard shortcuts

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