topic

package
v0.0.0-...-c60e208 Latest Latest
Warning

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

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

Documentation

Overview

Package topic contains topic application services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RBAC

type RBAC interface {
}

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

Service represents topic application interface

type Topic

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

Topic represents topic application service

func Initialize

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

Initialize initalizes Topic application service with defaults

func New

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

New creates new topic application service

func (*Topic) Create

func (u *Topic) Create(c echo.Context, req model.Topic) (*model.Topic, error)

Create creates a new topic account

func (*Topic) Delete

func (u *Topic) Delete(c echo.Context, id int) error

Delete deletes a topic

func (*Topic) List

func (u *Topic) List(c echo.Context, p *model.Pagination, query []string) ([]model.Topic, int, error)

List returns list of topics

func (*Topic) Update

func (u *Topic) Update(c echo.Context, req model.UpdateReq) (*model.Topic, error)

Update updates topic's contact information

func (*Topic) View

func (u *Topic) View(c echo.Context, query []string) (*model.Topic, error)

View returns single topic

type UDB

type UDB interface {
	Create(orm.DB, model.Topic) (*model.Topic, error)
	View(orm.DB, *model.FilterQuery) (*model.Topic, error)
	List(orm.DB, *model.FilterQuery, *model.Pagination) ([]model.Topic, int, error)
	Update(orm.DB, *model.Topic) error
	Delete(orm.DB, *model.Topic) error
}

UDB represents topic repository interface

Directories

Path Synopsis
platform

Jump to

Keyboard shortcuts

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