server

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backup added in v0.0.5

func Backup(w http.ResponseWriter, r *http.Request) error

func BackupHTTP added in v0.0.5

func BackupHTTP(w http.ResponseWriter, r *http.Request)

func BackupLocal added in v0.0.5

func BackupLocal() error

func ConnectDatabase added in v0.0.5

func ConnectDatabase() (*bbolt.DB, error)

ConnectDatabase initializes a boltdb database and returns a pointer to it.

func HashPassword

func HashPassword(s string) string

func NewHTTPError added in v0.0.5

func NewHTTPError(err error, status int, detail string) error

func Serve added in v0.0.5

func Serve()

Types

type Application added in v0.0.5

type Application struct {
	Application string `json:"application"`
	Username    string `json:"username"`
	Password    string `json:"password"`
	// contains filtered or unexported fields
}

type ClientError added in v0.0.5

type ClientError interface {
	Error() string
	Body() ([]byte, error)
	Headers() (int, map[string]string)
}

type DBError added in v0.0.5

type DBError struct {
	Message string
	Status  string
}

func (*DBError) Error added in v0.0.5

func (dberror *DBError) Error() string

type HTTPError added in v0.0.5

type HTTPError struct {
	Cause   error  `json:"-"`
	Details string `json:"details"`
	Status  int    `json:"-"`
}

func (*HTTPError) Body added in v0.0.5

func (e *HTTPError) Body() ([]byte, error)

func (*HTTPError) Error added in v0.0.5

func (e *HTTPError) Error() string

func (*HTTPError) Headers added in v0.0.5

func (e *HTTPError) Headers() (int, map[string]string)

type MasterPass added in v0.0.5

type MasterPass struct {
	MasterPassword string `json:"master_password"`
}

type Password

type Password struct {
	PlainText string `json:"password"`
	// contains filtered or unexported fields
}

func NewPassword

func NewPassword() *Password

NewPassword returns a pointer to a new password.

type Record added in v0.0.5

type Record struct {
	Bucket string
	Key    []byte
	Value  []byte
}

func (*Record) AddRecord added in v0.0.5

func (r *Record) AddRecord() error

AddRecord creates a bucket and a key value pair inside of the bucket using a record for values.

func (*Record) DeleteEncryptedRecord added in v0.0.5

func (r *Record) DeleteEncryptedRecord() error

func (*Record) DeleteRecord added in v0.0.5

func (r *Record) DeleteRecord() error

func (*Record) FindCorrectRecord added in v0.0.5

func (r *Record) FindCorrectRecord() error

FindCorrectRecord loops through a bucket's key/values and compares the key to the key in the record. It decrypts the existing key to do the comparison.

func (*Record) GetRecord added in v0.0.5

func (r *Record) GetRecord() error

GetRecord reads a bucket's key/value pair based on the values in a record.

type Route added in v0.0.5

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes added in v0.0.5

type Routes []Route

type Status added in v0.0.5

type Status struct {
	State string `json:"state"`
}

type User added in v0.0.5

type User struct {
	Username string
	Pass     *Password
}

User holds information about a user.

Jump to

Keyboard shortcuts

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