hypercache

package
v0.0.0-...-e753080 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseImplementation

type BaseImplementation interface {
	// Ping is used to ping the server.
	Ping() error

	// Get is used to get a record.
	Get(key []byte) ([]byte, error)
}

BaseImplementation is implementation functionality used by both HTTP and HNP.

type ClientError

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

ClientError is the base error for client errors. All other returned errors wrap this.

func (ClientError) Error

func (e ClientError) Error() string

type DatabaseNotFound

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

DatabaseNotFound is thrown when the database specified is not found.

func (DatabaseNotFound) Error

func (e DatabaseNotFound) Error() string

func (DatabaseNotFound) Unwrap

func (e DatabaseNotFound) Unwrap() error

type HNPImplementation

type HNPImplementation interface {
	BaseImplementation

	// AddEventHandler is used to add a handler for custom events.
	// Note that the bytes should not be mutated.
	AddEventHandler(ch chan []byte)

	// MutexLock is used to lock a global mutex.
	MutexLock() error

	// MutexUnlock is used to unlock a globally locked mutex.
	MutexUnlock() error

	// SendEvent is used to send an event to the HyperCache server.
	SendEvent(b []byte) error
}

HNPImplementation includes HNP exclusive functionality.

func NewConnectionWithHNPAddr

func NewConnectionWithHNPAddr(addr, password string, db uint16) (HNPImplementation, error)

NewConnectionWithHNPAddr is used to connect with a HNP address.

func NewConnectionWithHNPSocket

func NewConnectionWithHNPSocket(c net.Conn, password string, db uint16) (HNPImplementation, error)

NewConnectionWithHNPSocket is used to connect with a newly made HNP socket.

type InvalidCredentials

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

InvalidCredentials is returned when the users credentials are invalid.

func (InvalidCredentials) Error

func (e InvalidCredentials) Error() string

func (InvalidCredentials) Unwrap

func (e InvalidCredentials) Unwrap() error

type InvalidPacket

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

InvalidPacket is returned by the server when it deems a packet as invalid.

func (InvalidPacket) Error

func (e InvalidPacket) Error() string

func (InvalidPacket) Unwrap

func (e InvalidPacket) Unwrap() error

type NotFound

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

NotFound is returned when the record is not found.

func (NotFound) Error

func (e NotFound) Error() string

func (NotFound) Unwrap

func (e NotFound) Unwrap() error

type UnlockError

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

UnlockError is returned when a mutex is unable to be unlocked.

func (UnlockError) Error

func (e UnlockError) Error() string

func (UnlockError) Unwrap

func (e UnlockError) Unwrap() error

Jump to

Keyboard shortcuts

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