store

package
v0.0.0-...-877ff3d Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// Code is error code
	Code ErrorCode
	// Msg is error description message
	Msg error
}

Error encapsulates ErrorCode and adds a simple error description

func (*Error) Error

func (e *Error) Error() string

Error interface implementation to satisfy builtin error interface

type ErrorCode

type ErrorCode int

ErrorCode defines Store operation error code

const (
	// ErrNotFound signals the data could not be found
	ErrNotFound ErrorCode = iota + 1
)

func (ErrorCode) String

func (ec ErrorCode) String() string

String method implementation to satisfy fmt.Stringer interface

type Store

type Store interface {
	// Write writes data to store
	Write(p []byte) (int, error)
	// Read reads data from store
	Read(p []byte) (int, error)
}

Store implements basic data store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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