apis

package
v0.0.0-...-bcdc46a Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceTypePriorityQueue = "pqueue"

ServiceTypePriorityQueue defines a priority queue service type identifier.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryMarshaller

type BinaryMarshaller interface {
	Unmarshal(data []byte) error
	Marshal() (data []byte, err error)
}

BinaryMarshaller is the marshaling interface for binary data.

type DataStorage

type DataStorage interface {
	WaitFlush()
	CachedStore2(key1 string, data1 []byte, key2 string, data2 []byte)
	CachedStore(key string, data []byte)
	DeleteDataWithPrefix(prefix string) int
	StoreData(key string, data []byte) error
	FlushCache()
	DeleteData(key ...string) error
	DeleteCacheData(id ...string)
	IterData(prefix string) ItemIterator
	GetData(id string) []byte
	GetStats() map[string]interface{}
	Close()
	IsClosed() bool
}

DataStorage is an abstracted interface over the key/value storage currently the main purpose is to to prepend prefixes to the data key.

type IResponse

type IResponse interface {
	// GetResponse returns serialized string of data that can be returned to the client.
	StringResponse() string
	// WriteResponse writes the response data directly into writer.
	WriteResponse(buf *bufio.Writer) error
	// IsError tells if this response is actually an error.
	IsError() bool
}

IResponse is a standard interface to any returned data.

type IResponseItem

type IResponseItem interface {
	WriteResponse(b *bufio.Writer) error
	ID() string
	Payload() []byte
}

IResponseItem is an existing data response.

type IServer

type IServer interface {
	Start()
	Stop()
}

IServer is a server interface that can be started or stopped.

type IServices

type IServices interface {
	GetService(string) (ISvc, bool)
}

IServices all instantiated service container interface.

type ISvc

type ISvc interface {
	NewContext(ResponseWriter) ServiceContext
	StartUpdate()
	Info() ServiceInfo
	Close()
}

ISvc a service interface used to start/stop and receive basic service info.

type ItemIterator

type ItemIterator interface {
	Next()
	Valid() bool
	Close()
	GetValue() []byte
	GetKey() []byte
	GetTrimKey() []byte
}

ItemIterator is an iterator interface over key/value storage.

type ResponseWriter

type ResponseWriter interface {
	WriteResponse(IResponse) error
}

ResponseWriter is a writer of IResponse object.

type ServiceContext

type ServiceContext interface {
	Call(cmd string, params []string) IResponse
	Finish()
}

ServiceContext is a user protocol parser in scope of a single connection.

type ServiceInfo

type ServiceInfo struct {
	Type string
	Size int
	ID   string
}

ServiceInfo provide the most basic current information about service.

Jump to

Keyboard shortcuts

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