database

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrNotFound

func IsErrNotFound(err error) bool

IsErrNotFound returs true if err is type of ErrNotFound, false otherwise.

Types

type DecodeError

type DecodeError struct {
	ID string
}

DecodeError represents a service impossible to decode.

func (*DecodeError) Error

func (e *DecodeError) Error() string

type ErrNotFound

type ErrNotFound struct {
	ID string
}

ErrNotFound is an not found error.

func (*ErrNotFound) Error

func (e *ErrNotFound) Error() string

type ServiceDB

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

ServiceDB is a database for storing service definition.

func NewServiceDB

func NewServiceDB(path string) (*ServiceDB, error)

NewServiceDB returns database which is located under given path.

func (*ServiceDB) All

func (db *ServiceDB) All() ([]*service.Service, error)

All returns every service in database.

func (*ServiceDB) Close

func (db *ServiceDB) Close() error

Close closes database.

func (*ServiceDB) Delete

func (db *ServiceDB) Delete(id string) error

Delete deletes service from database.

func (*ServiceDB) Get

func (db *ServiceDB) Get(id string) (*service.Service, error)

Get retrives service from database.

func (*ServiceDB) Save

func (db *ServiceDB) Save(s *service.Service) error

Save stores service in database.

Jump to

Keyboard shortcuts

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