server

package
v0.0.0-...-db87d58 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Name     string `json:"name"`
	Complete bool   `json:"complete"`
}

Chunk is a piece of data that contaions the messages that were written to it. It can be incomplete which means that it currently being written into.

type InMemory

type InMemory struct {
	// contains filtered or unexported fields
}

InMemory store all data in memory

func (*InMemory) Ack

func (s *InMemory) Ack() error

Ack mark the current chunk as done and delete it's contents.

func (*InMemory) Read

func (s *InMemory) Read(off uint64, maxSize uint64, w io.Writer) error

Read copies the data from the in-memory store and writes the data read to the the provided Writer, starting with the offset provided.

func (*InMemory) Write

func (s *InMemory) Write(msgs []byte) error

Write accepts the messages from the clients and store them.

type OnDisk

type OnDisk struct {
	// contains filtered or unexported fields
}

OnDisk store all data in Disk

func NewOnDisk

func NewOnDisk(fp *os.File) *OnDisk

func (*OnDisk) Ack

func (s *OnDisk) Ack() error

Ack mark the current chunk as done and delete it's contents.

func (*OnDisk) Read

func (s *OnDisk) Read(off uint64, maxSize uint64, w io.Writer) error

Read copies the data from the in-memory store and writes the data read to the the provided Writer, starting with the offset provided.

func (*OnDisk) Write

func (s *OnDisk) Write(msgs []byte) error

Write accepts the messages from the clients and store them.

Jump to

Keyboard shortcuts

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