Documentation ¶
Index ¶
- func MakeCreateEventEndpoint(s Service) endpoint.Endpoint
- func MakeDeleteEventEndpoint(s Service) endpoint.Endpoint
- func MakeListEventEndpoint(s Service) endpoint.Endpoint
- func MakeServiceStatusEndpoint(s Service) endpoint.Endpoint
- func NewGRPCServer(ep Set) pb.CalendarServer
- type CreateEventRequest
- type CreateEventResponse
- type DeleteEventRequest
- type DeleteEventResponse
- type ListEventRequest
- type ListEventResponse
- type Service
- type ServiceStatusRequest
- type ServiceStatusResponse
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeCreateEventEndpoint ¶
MakeCreateEventEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure
func MakeDeleteEventEndpoint ¶
MakeDeleteEventEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure
func MakeListEventEndpoint ¶
MakeListEventEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure
func MakeServiceStatusEndpoint ¶
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 ¶
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