event

package
v0.0.0-...-304dadd Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package event contains event application services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

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

Event represents event application service

func Initialize

func Initialize(db *pg.DB, rbac RBAC, sec Securer) *Event

Initialize initalizes Event application service with defaults

func New

func New(db *pg.DB, udb UDB, rbac RBAC, sec Securer) *Event

New creates new event application service

func (*Event) Create

func (e *Event) Create(c echo.Context, req takrib.Event) (*takrib.Event, error)

Create creates a new event account

func (*Event) Delete

func (e *Event) Delete(c echo.Context, id int) error

Delete deletes a event

func (*Event) List

func (e *Event) List(c echo.Context, p *takrib.Pagination) ([]takrib.Event, error)

List returns list of events

func (*Event) Update

func (e *Event) Update(c echo.Context, req *Update) (*takrib.Event, error)

Update updates event's contact information

func (*Event) View

func (e *Event) View(c echo.Context, id int) (*takrib.Event, error)

View returns single event

type RBAC

type RBAC interface {
	User(echo.Context) *takrib.AuthUser
	EnforceUser(echo.Context, int) error
	IsLowerRole(echo.Context, takrib.AccessRole) error
}

RBAC represents role-based-access-control interface

type Securer

type Securer interface {
	Hash(string) string
}

Securer represents security interface

type Service

type Service interface {
	Create(echo.Context, takrib.Event) (*takrib.Event, error)
	List(echo.Context, *takrib.Pagination) ([]takrib.Event, error)
	View(echo.Context, int) (*takrib.Event, error)
	Delete(echo.Context, int) error
	Update(echo.Context, *Update) (*takrib.Event, error)
}

Service represents event application interface

type UDB

type UDB interface {
	Create(orm.DB, takrib.Event) (*takrib.Event, error)
	View(orm.DB, int) (*takrib.Event, error)
	List(orm.DB, *takrib.ListQuery, *takrib.Pagination) ([]takrib.Event, error)
	Update(orm.DB, *takrib.Event) error
	Delete(orm.DB, *takrib.Event) error
}

UDB represents event repository interface

type Update

type Update struct {
	ID        int
	Eventname *string
	Location  *string
}

Update contains event's information used for updating

Directories

Path Synopsis
platform

Jump to

Keyboard shortcuts

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