simpleserver

package
v0.0.0-...-7066845 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPServer

func NewHTTPServer(addr string) *http.Server

Types

type HTTPServer

type HTTPServer struct {
	Log *Log
}

type Log

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

func NewLog

func NewLog() *Log

func (*Log) Append

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

func (*Log) Read

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

type ReadReq

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

type ReadRsp

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

type Record

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

type WriteReq

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

type WriteRsp

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

Jump to

Keyboard shortcuts

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