container

package
v0.0.0-...-35e313c Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotFound = "Container not found"
)

Messages

View Source
const Type string = "Container"

Type of model

Variables

View Source
var ErrContainerNotFound = errors.New("container not found")

ErrContainerNotFound is to be returned if container is not found for its ID

Functions

func NameExists

func NameExists(SD *datastore.DataStore, UID user.ID, name string) (bool, error)

NameExists checks whether container name exists

func PersistenceCreate

func PersistenceCreate(SD *datastore.DataStore, name string) (string, error)

PersistenceCreate creates new container with name

Types

type Container

type Container struct {
	ID      ID        `json:"_id,omitempty" db:"ID,omitempty"`
	UserID  user.ID   `json:"-" db:"USER_ID,omitempty"`
	Name    Name      `json:"name,omitempty" db:"NAME,omitempty"`
	Created time.Time `json:"created,omitempty" db:"CREATED,omitempty"`
	Updated time.Time `json:"updated,omitempty" db:"UPDATED,omitempty"`
}

Container represents collection of the objects

func GetFromPersistenceByID

func GetFromPersistenceByID(SD *datastore.DataStore, containerID ID) (*Container, error)

GetFromPersistenceByID get the container by its ID

type Containers

type Containers []Container

Containers list of containers

type ID

type ID string

ID container id

func PersistenceDelete

func PersistenceDelete(SD *datastore.DataStore) (ID, error)

Delete deletes the container by its ID

type Model

type Model struct {
	DataStore *datastore.DataStore
}

Model #

func (Model) ByID

func (m Model) ByID(id ID) (*Container, string, int, *storeerr.Errors)

ByID #

func (Model) Create

func (m Model) Create(name string) (string, string, int, *storeerr.Errors)

Create new Container

func (Model) Delete

func (m Model) Delete(id ID) (ID, string, int, *storeerr.Errors)

Delete #

func (Model) Get

func (m Model) Get() (Containers, string, int, *storeerr.Errors)

Get #

func (Model) UpdateName

func (m Model) UpdateName(id ID, name string) (string, int, *storeerr.Errors)

UpdateName #

type Name

type Name string

Name container Name

Jump to

Keyboard shortcuts

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