psql

package
v0.0.0-...-eb21043 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresStorage

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

PostgresStorage struct

func NewPostgresStorage

func NewPostgresStorage(config utilities.Config) (*PostgresStorage, error)

NewPostgresStorage create new psql connection

func (*PostgresStorage) AddEvent

func (e *PostgresStorage) AddEvent(ctx context.Context, event models.Event) error

AddEvent add new event

func (*PostgresStorage) DelEvent

func (e *PostgresStorage) DelEvent(ctx context.Context, id uuid.UUID) error

DelEvent Delete event

func (*PostgresStorage) GetEventByID

func (e *PostgresStorage) GetEventByID(ctx context.Context, id uuid.UUID) (models.Event, error)

GetEventByID Get event by ID

func (*PostgresStorage) ListAllEvents

func (e *PostgresStorage) ListAllEvents(ctx context.Context) ([]models.Event, error)

ListAllEvents Get slice of all events

func (*PostgresStorage) ListEvents

func (e *PostgresStorage) ListEvents(ctx context.Context, startdate time.Time, enddate time.Time) ([]models.Event, error)

ListEvents Get slice of events

func (*PostgresStorage) UpdateEvent

func (e *PostgresStorage) UpdateEvent(ctx context.Context, id uuid.UUID, newEvent models.Event) error

UpdateEvent Edit event

Jump to

Keyboard shortcuts

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