service

package
v0.0.0-...-e14e903 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BodyParser

type BodyParser func(out interface{}) error

BodyParser a fiber BodyParser abstraction

type ChannelGroupService

type ChannelGroupService struct {
}

ChannelGroupService channel group service class

func (ChannelGroupService) Create

Create create a channel group

func (ChannelGroupService) Delete

Delete delete a channel group by id

func (ChannelGroupService) GetAll

func (c ChannelGroupService) GetAll() []model.ChannelGroup

GetAll find all channel groups

func (ChannelGroupService) GetOne

GetOne find a channel group by id

func (ChannelGroupService) Update

func (c ChannelGroupService) Update(id string, channelGroup model.ChannelGroup) exception.HttpError

Update update a channel group by id

type ChannelService

type ChannelService struct {
}

ChannelService channel services class

func (ChannelService) Create

Create create a server

func (ChannelService) Delete

Delete delete a server by id

func (ChannelService) GetAll

func (c ChannelService) GetAll() []model.Channel

GetAll find all registered users

func (ChannelService) GetOne

GetOne find a user by id

func (ChannelService) Update

func (c ChannelService) Update(id string, channel model.Channel) exception.HttpError

Update update a server

type MessageService

type MessageService struct {
}

MessageService message service class

func (MessageService) Create

Create create a message

func (MessageService) Delete

Delete delete a message by id

func (MessageService) GetAll

func (m MessageService) GetAll() []model.Message

GetAll find all registered messages

func (MessageService) GetOne

GetOne find a message by id

func (MessageService) Update

func (m MessageService) Update(id string, message model.Message) exception.HttpError

Update update a message by id

type ServerService

type ServerService struct {
}

ServerService server services class

func (ServerService) Create

Create create a server

func (ServerService) Delete

func (s ServerService) Delete(id string) exception.HttpError

Delete delete a server by id

func (ServerService) GetAll

func (s ServerService) GetAll() []model.Server

GetAll find all registered users

func (ServerService) GetAllGroupChannels

func (s ServerService) GetAllGroupChannels(id string) ([]model.ChannelGroup, exception.HttpError)

GetAllGroupChannels find all channels by server id

func (ServerService) GetOne

GetOne find a user by id

func (ServerService) Update

func (s ServerService) Update(id string, server model.Server) exception.HttpError

Update update a server

type Service

type Service interface {
	FindAll() []interface{}

	FindById(stringId string) (interface{}, exception.HttpError)

	Create(bodyParser BodyParser) exception.HttpError

	Delete(stringId string) exception.HttpError

	Update(stringId string, bodyParser BodyParser) (interface{}, exception.HttpError)
}

Service service interface example

type UserService

type UserService struct {
}

UserService channel group service class

func (UserService) Create

func (u UserService) Create(user model.User) (model.User, exception.HttpError)

Create create a channel group

func (UserService) Delete

func (u UserService) Delete(id string) exception.HttpError

Delete delete a channel group by id

func (UserService) GetAll

func (u UserService) GetAll() []model.User

GetAll find all registered channel groups

func (UserService) GetOne

func (u UserService) GetOne(id string) (model.User, exception.HttpError)

GetOne find a channel group by id

func (UserService) Login

func (u UserService) Login(user model.User) (string, exception.HttpError)

Login log in with a user

func (UserService) Update

func (u UserService) Update(id string, user model.User) exception.HttpError

Update update a channel group by id

Jump to

Keyboard shortcuts

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