voteslog

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExists = errors.New("msg with such index already exists")

Functions

This section is empty.

Types

type FileVotesLog added in v0.0.2

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

func NewOnDiskLog added in v0.0.2

func NewOnDiskLog(dir string) (*FileVotesLog, error)

func (*FileVotesLog) Close added in v0.0.2

func (c *FileVotesLog) Close() error

func (*FileVotesLog) Get added in v0.0.2

func (c *FileVotesLog) Get(index uint64) (string, []byte, bool)

func (*FileVotesLog) GetVotes added in v0.0.2

func (c *FileVotesLog) GetVotes(index uint64) []*entity.Vote

func (*FileVotesLog) Set added in v0.0.2

func (c *FileVotesLog) Set(index uint64, key string, value []byte) error

func (*FileVotesLog) SetVotes added in v0.0.2

func (c *FileVotesLog) SetVotes(index uint64, votes []*entity.Vote) error

type InmemVotesLog added in v0.0.2

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

func NewInmemLog added in v0.0.2

func NewInmemLog() *InmemVotesLog

func (*InmemVotesLog) Close added in v0.0.2

func (c *InmemVotesLog) Close() error

func (*InmemVotesLog) Get added in v0.0.2

func (c *InmemVotesLog) Get(index uint64) (string, []byte, bool)

func (*InmemVotesLog) GetVotes added in v0.0.2

func (c *InmemVotesLog) GetVotes(index uint64) []*entity.Vote

func (*InmemVotesLog) Set added in v0.0.2

func (c *InmemVotesLog) Set(index uint64, key string, value []byte) error

func (*InmemVotesLog) SetVotes added in v0.0.2

func (c *InmemVotesLog) SetVotes(index uint64, votes []*entity.Vote) error

type Log added in v0.0.2

type Log interface {
	Set(index uint64, key string, value []byte) error
	Get(index uint64) (string, []byte, bool)
	SetVotes(index uint64, votes []*entity.Vote) error
	GetVotes(index uint64) []*entity.Vote
	Close() error
}

Jump to

Keyboard shortcuts

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