sponsor

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

Service represents sponsor application interface

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

Sponsor represents sponsor application service

func Initialize

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

Initialize initalizes sponsor application service with defaults

func New

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

New creates new sponsor application service

func (*Sponsor) Create

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

Create creates a new Sponsor account

func (*Sponsor) Delete

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

Delete deletes a Sponsor

func (*Sponsor) List

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

List returns list of Sponsors

func (*Sponsor) Update

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

Update updates sponsor's contact information

func (*Sponsor) View

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

View returns single Sponsor

type UDB

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

UDB represents sponsor repository interface

type Update

type Update struct {
	ID          int
	Name        *string
	Description *string
	URL         *string
	LogoURL     *string
	SponsorType *string
}

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