friends

package
v0.0.0-...-d3354c4 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: LGPL-2.1 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("Error Friend not found")

Functions

This section is empty.

Types

type AuthFunc

type AuthFunc func(ID) bool

type BasicFriend

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

func NewBasicFriend

func NewBasicFriend(publicKey crypto.PublicKey) *BasicFriend

func (*BasicFriend) ID

func (bf *BasicFriend) ID() ID

func (*BasicFriend) PublicKey

func (bf *BasicFriend) PublicKey() crypto.PublicKey

type BasicStore

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

func NewBasicList

func NewBasicList() *BasicStore

func (*BasicStore) Contains

func (bfs *BasicStore) Contains(id ID) bool

func (*BasicStore) Get

func (bfs *BasicStore) Get(id ID) (Friend, error)

func (*BasicStore) Put

func (bfs *BasicStore) Put(f Friend) error

func (*BasicStore) Scan

func (bfs *BasicStore) Scan(f func(Friend) bool) error

type Friend

type Friend interface {
	ID() ID
	PublicKey() crypto.PublicKey
}

type ID

type ID string

func NewID

func NewID(pub crypto.PublicKey) (ID, error)

func (ID) B64String

func (id ID) B64String() string

func (ID) MarshalJSON

func (id ID) MarshalJSON() ([]byte, error)

func (ID) String

func (id ID) String() string

func (*ID) UnmarshalJSON

func (id *ID) UnmarshalJSON(p []byte) error

type Sink

type Sink interface {
	Put(Friend) error
}

type Source

type Source interface {
	Get(ID) (Friend, error)
	Contains(ID) bool
	Scan(f func(Friend) bool) error
}

type Store

type Store interface {
	Source
	Sink
}

Jump to

Keyboard shortcuts

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