server

package
v0.0.0-...-2726815 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

Backend implements the protobuf interface

func New

func New() *Backend

New initializes a new Backend struct.

func (*Backend) AddEvent

func (b *Backend) AddEvent(ctx context.Context, req *pbEvent.AddEventRequest) (*pbEvent.EventDTO, error)

AddEvent : save one event

func (*Backend) AddUser

func (b *Backend) AddUser(ctx context.Context, req *pbUser.AddUserRequest) (*pbUser.UserDTO, error)

AddUser adds a user to the database

func (*Backend) DeleteEvent

DeleteEvent delete one event in the database.

func (*Backend) DeleteUser

DeleteUser delete one user in the database.

func (*Backend) GetEvent

func (b *Backend) GetEvent(ctx context.Context, req *pbEvent.GetEventRequest) (*pbEvent.EventDTO, error)

GetEvent : get one event

func (*Backend) GetUser

func (b *Backend) GetUser(ctx context.Context, req *pbUser.GetUserRequest) (*pbUser.UserDTO, error)

GetUser get one user in the database.

func (*Backend) Initialize

func (b *Backend) Initialize(Dbdriver, DbUser, DbPassword, DbPort, DbHost, DbName string) *Backend

Initialize : init router and database link

func (*Backend) ListEvents

ListEvents lists all events in the store.

func (*Backend) ListUsers

ListUsers lists all users in the database.

func (*Backend) UpdateEvent

func (b *Backend) UpdateEvent(ctx context.Context, req *pbEvent.UpdateEventRequest) (*pbEvent.EventDTO, error)

UpdateEvent adds a event to the database

func (*Backend) UpdateUser

func (b *Backend) UpdateUser(ctx context.Context, req *pbUser.UpdateUserRequest) (*pbUser.UserDTO, error)

UpdateUser adds a user to the database

Jump to

Keyboard shortcuts

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