storage

package
v0.0.0-...-00872a6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activities

type Activities []Activity

Activities list of activities

type Activity

type Activity struct {
	ID             string   `bson:"_id"`
	ActivityTypeID string   `bson:"activitytype_id"`
	OrderID        string   `bson:"order_id"`
	Period         Interval `bson:"interval"`
}

Activity activity model for storage

type Interval

type Interval struct {
	From time.Time `bson:"from"`
	To   time.Time `bson:"to"`
}

Interval interval data structure

func NewIntervalProto

func NewIntervalProto(from, to *timestamp.Timestamp) (*Interval, error)

NewIntervalProto creates the interval from protos

type Repository

type Repository interface {
	Create(context.Context, Activity) (*uuid.UUID, error)
	Read(context.Context, uuid.UUID) (*Activity, error)
	Exist(context.Context, uuid.UUID) (*bool, error)
	Update(context.Context, Activity) error
	Delete(context.Context, uuid.UUID) error
	List(context.Context, []uuid.UUID) (Activities, error)
	ListInInterval(context.Context, Interval) (Activities, error)
}

Repository Repository interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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