speaker

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 speaker contains speaker application services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.Speaker) (*takrib.Speaker, error)
	List(echo.Context, *takrib.Pagination) ([]takrib.Speaker, error)
	View(echo.Context, int) (*takrib.Speaker, error)
	Delete(echo.Context, int) error
	Update(echo.Context, *Update) (*takrib.Speaker, error)
}

Service represents speaker application interface

type Speaker

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

Speaker represents speaker application service

func Initialize

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

Initialize initalizes speaker application service with defaults

func New

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

New creates new speaker application service

func (*Speaker) Create

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

Create creates a new speaker account

func (*Speaker) Delete

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

Delete deletes a speaker

func (*Speaker) List

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

List returns list of speakers

func (*Speaker) Update

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

Update updates speaker's contact information

func (*Speaker) View

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

View returns single speaker

type UDB

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

UDB represents speaker repository interface

type Update

type Update struct {
	ID                int
	Name              *string
	ShortBiography    *string
	LongBiography     *string
	Gender            *string
	Email             *string
	Mobile            *string
	Website           *string
	Twitter           *string
	Github            *string
	Linkedin          *string
	Organisation      *string
	Position          *string
	Country           *string
	City              *string
	PhotoURL          *string
	ThumbnailImageURL *string
}

Update contains speaker'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