bitskeys

package
v0.0.0-...-b1d3944 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2016 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedKeyFormats = []string{"b64-textlines", "mem"}

SupportedKeyFormats holds identifiers for all supported stores

Functions

func CreateKeyReader

func CreateKeyReader(iotype string, r io.Reader) (kr bits.KeyReader, err error)

CreateKeyReader attempts to create a specific writer

func CreateKeyWriter

func CreateKeyWriter(iotype string, w io.Writer) (kw bits.KeyWriter, err error)

CreateKeyWriter attempts to create a specific writer

Types

type MemIterator

type MemIterator struct {
	Keys []bits.K
	// contains filtered or unexported fields
}

MemIterator stores key in memory for iteration. It also conveniently implements the KeyIndex and KeyHandler interface

func NewMemIterator

func NewMemIterator() *MemIterator

NewMemIterator creates an empty iterator

func NewPopulatedMemIterator

func NewPopulatedMemIterator(keys []bits.K) *MemIterator

NewPopulatedMemIterator creates a preopulated iterator

func (*MemIterator) Read

func (iter *MemIterator) Read() (k bits.K, err error)

Next returns a new key or io.EOF if no more keys are available

func (*MemIterator) Reset

func (iter *MemIterator) Reset()

Reset the iterator to index 0

func (*MemIterator) Write

func (iter *MemIterator) Write(k bits.K) (err error)

Handle appends a new key to the internal slice

type TextLineKeyReader

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

TextLineKeyReader writes keys in encoded, each on a new line

func (*TextLineKeyReader) Read

func (kr *TextLineKeyReader) Read() (k bits.K, err error)

Read implementes key reader

func (*TextLineKeyReader) Reset

func (kr *TextLineKeyReader) Reset()

Reset is not possible for this reader

type TextLineKeyWriter

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

TextLineKeyWriter writes keys in encoded, each on a new line

func (*TextLineKeyWriter) Write

func (kw *TextLineKeyWriter) Write(k bits.K) (err error)

Write implementes key writer

Jump to

Keyboard shortcuts

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