server

package
v0.0.0-...-afe1ddf Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOffsetNotFound = fmt.Errorf("offset not found")
)

Functions

func NewHTTPServer

func NewHTTPServer(addr string) *http.Server

Types

type ConsumeRequest

type ConsumeRequest struct {
	Offset uint64 `json:"offset"`
}

type ConsumeResponse

type ConsumeResponse struct {
	Record Record `json:"record"`
}

type Log

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

func NewLog

func NewLog() *Log

func (*Log) Append

func (l *Log) Append(record Record) (uint64, error)

func (*Log) Read

func (l *Log) Read(offset uint64) (Record, error)

type ProduceRequest

type ProduceRequest struct {
	Record Record `json:"record"`
}

type ProduceResponse

type ProduceResponse struct {
	Offset uint64 `json:"offset"`
}

type Record

type Record struct {
	Value  []byte `json:"value"`
	Offset uint64 `json:offset"`
}

Jump to

Keyboard shortcuts

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