fiwareRepository

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Sqlite = iota
)

Variables

View Source
var (
	ErrNotFound      = errors.New("not found")
	ErrCouldNotQuery = errors.New("couldn't query")
	ErrCouldNotExec  = errors.New("couldn't Exec")
)

Functions

This section is empty.

Types

type FiwareRepo

type FiwareRepo interface {
	AddFiwareService(string) error
	GetFiwareService(string) (*FiwareServiceRow, error)
	ListFiwareServices() (FiwareServiceRows, error)
	UpdateFiwareService(string, string) error
	DeleteFiwareService(string) error
	SetIdGen(func() string)
	FindFiwareServiceByName(string) (FiwareServiceRows, error)
	AddIota(string, int, string) error
	GetIota(string) (*i.IoTA, error)
	ListIotas() (IotaRows, error)
	DeleteIota(string) error
}

func NewFiwareRepo

func NewFiwareRepo(i RepoType) (FiwareRepo, error)

type FiwareServiceRow

type FiwareServiceRow struct {
	Id        string
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (FiwareServiceRow) ToFiwareService

func (r FiwareServiceRow) ToFiwareService() *i.FiwareService

type FiwareServiceRows

type FiwareServiceRows []FiwareServiceRow

func (FiwareServiceRows) ToFiwareServices

func (rs FiwareServiceRows) ToFiwareServices() []*i.FiwareService

type IotaRow

type IotaRow struct {
	Id        string
	Alias     string
	Host      string
	Port      int
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (IotaRow) ToIoTA

func (r IotaRow) ToIoTA() *i.IoTA

type IotaRows

type IotaRows []IotaRow

func (IotaRows) ToIoTAs

func (rs IotaRows) ToIoTAs() []*i.IoTA

type RepoType

type RepoType int

func (RepoType) String

func (r RepoType) String() string

type SqliteRepo

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

func (*SqliteRepo) AddFiwareService

func (sr *SqliteRepo) AddFiwareService(service string) error

func (*SqliteRepo) AddIota

func (sr *SqliteRepo) AddIota(host string, port int, alias string) error

func (*SqliteRepo) DeleteFiwareService

func (sr *SqliteRepo) DeleteFiwareService(id string) error

func (*SqliteRepo) DeleteIota

func (sr *SqliteRepo) DeleteIota(id string) error

func (*SqliteRepo) FindFiwareServiceByName

func (sr *SqliteRepo) FindFiwareServiceByName(name string) (FiwareServiceRows, error)

func (*SqliteRepo) GetFiwareService

func (sr *SqliteRepo) GetFiwareService(id string) (*FiwareServiceRow, error)

func (*SqliteRepo) GetIota

func (sr *SqliteRepo) GetIota(id string) (*i.IoTA, error)

func (*SqliteRepo) ListFiwareServices

func (sr *SqliteRepo) ListFiwareServices() (FiwareServiceRows, error)

func (*SqliteRepo) ListIotas

func (sr *SqliteRepo) ListIotas() (IotaRows, error)

func (*SqliteRepo) SetIdGen

func (sr *SqliteRepo) SetIdGen(f func() string)

func (*SqliteRepo) UpdateFiwareService

func (sr *SqliteRepo) UpdateFiwareService(id string, name string) error

Jump to

Keyboard shortcuts

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