lib

package
v0.0.0-...-3ad82cb Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorJSON

func ErrorJSON(w http.ResponseWriter, error string, code int)

func WriteJSON

func WriteJSON(w http.ResponseWriter, body interface{})

Types

type DB

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

func NewDB

func NewDB(path string) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) Delete

func (db *DB) Delete(user, key string) error

func (*DB) Get

func (db *DB) Get(user, key string) (string, error)

func (*DB) Keys

func (db *DB) Keys(user string) ([]string, error)

func (*DB) Put

func (db *DB) Put(user, key string, value []byte) error

type DBService

type DBService interface {
	Keys(user string) ([]string, error)
	Put(user, key string, value []byte) error
	Get(user, key string) (string, error)
	Delete(user, key string) error
	Close() error
}

type Entity

type Entity struct {
	User       string
	EntityList openpgp.EntityList
}

func NewEntity

func NewEntity(path string, callback PromptFunction) (*Entity, error)

func (*Entity) GetIdentity

func (e *Entity) GetIdentity() string

func (*Entity) PGPEntity

func (e *Entity) PGPEntity() *openpgp.Entity

type EntityStorage

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

func NewEntityStorage

func NewEntityStorage(path string) (*EntityStorage, error)

func (*EntityStorage) EntityForIdentity

func (es *EntityStorage) EntityForIdentity(identity string) *Entity

type MockDB

type MockDB struct{}

func (*MockDB) Close

func (db *MockDB) Close() error

func (*MockDB) Delete

func (db *MockDB) Delete(user, key string) error

func (*MockDB) Get

func (db *MockDB) Get(user, key string) (string, error)

func (*MockDB) Keys

func (db *MockDB) Keys(user string) ([]string, error)

func (*MockDB) Put

func (db *MockDB) Put(user, key string, value []byte) error

type PromptFunction

type PromptFunction func(entity *Entity) ([]byte, error)

type Request

type Request struct {
	UserName      string
	IdentityName  string
	EntityList    openpgp.EntityList
	EncryptedBody []byte
	*http.Request
}

func AuthenticatedRequest

func AuthenticatedRequest(r *http.Request, es *EntityStorage) (*Request, error)

func NewRequest

func NewRequest(method, urlStr string, body []byte) (*Request, error)

func (*Request) CheckSignature

func (r *Request) CheckSignature() error

func (*Request) Sign

func (r *Request) Sign(entity *Entity) error

func (*Request) Signature

func (r *Request) Signature(entity *Entity) (string, error)

func (*Request) SignatureMessage

func (r *Request) SignatureMessage() string

Jump to

Keyboard shortcuts

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