calendar

package module
v0.0.0-...-4c04d20 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCreateEventEndpoint

func MakeCreateEventEndpoint(s Service) endpoint.Endpoint

MakeCreateEventEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure

func MakeDeleteEventEndpoint

func MakeDeleteEventEndpoint(s Service) endpoint.Endpoint

MakeDeleteEventEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure

func MakeListEventEndpoint

func MakeListEventEndpoint(s Service) endpoint.Endpoint

MakeListEventEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure

func MakeServiceStatusEndpoint

func MakeServiceStatusEndpoint(s Service) endpoint.Endpoint

MakeServiceStatusEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure

func NewGRPCServer

func NewGRPCServer(ep Set) pb.CalendarServer

Types

type CreateEventRequest

type CreateEventRequest struct {
	Event repository.Event `json:"event"`
}

CreateEventRequest -> CreateEvent endpoint's input structures

type CreateEventResponse

type CreateEventResponse struct {
	EventId string `json:"event_id,omitempty"`
	Err     string `json:"err,omitempty"`
}

CreateEventResponse -> CreateEvent endpoint's output structure

type DeleteEventRequest

type DeleteEventRequest struct {
	EventId string `json:"event_id"`
	UserId  uint64 `json:"user_id"`
}

DeleteEventRequest -> DeleteEvent endpoint's input structures

type DeleteEventResponse

type DeleteEventResponse struct {
	Err string `json:"err,omitempty"`
}

DeleteEventResponse -> DeleteEvent endpoint's output structure

type ListEventRequest

type ListEventRequest struct {
	UserId uint64 `json:"user_id"`
}

ListEventRequest -> ListEvent endpoint's input structures

type ListEventResponse

type ListEventResponse struct {
	Events []repository.Event `json:"events,omitempty"`
	Err    string             `json:"err,omitempty"`
}

ListEventResponse -> ListEvent endpoint's output structure

type Service

type Service interface {
	CreateEvent(ctx context.Context, event repository.Event) (string, error)
	ListEvent(ctx context.Context, userId uint64) ([]repository.Event, error)
	DeleteEvent(ctx context.Context, eventId string, userId uint64) error
	ServiceStatus(ctx context.Context) (int, error)
}

func NewService

func NewService(calendarRepository repository.CalendarRepository) Service

type ServiceStatusRequest

type ServiceStatusRequest struct{}

ServiceStatusRequest -> ServiceStatus endpoint's input structures

type ServiceStatusResponse

type ServiceStatusResponse struct {
	Code int    `json:"code,omitempty"`
	Err  string `json:"err,omitempty"`
}

ServiceStatusResponse -> ServiceStatus endpoint's output structure

type Set

type Set struct {
	CreateEventEndpoint   endpoint.Endpoint
	ListEventEndpoint     endpoint.Endpoint
	DeleteEventEndpoint   endpoint.Endpoint
	ServiceStatusEndpoint endpoint.Endpoint
}

func New

func New(s Service) Set

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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