endpoints

package
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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAddEventEndpoint

func MakeAddEventEndpoint(s webapi.Service) endpoint.Endpoint

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

func MakeDeleteEventEndpoint

func MakeDeleteEventEndpoint(s webapi.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 webapi.Service) endpoint.Endpoint

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

func MakeLoginEndpoint

func MakeLoginEndpoint(s webapi.Service) endpoint.Endpoint

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

func MakeLogoutEndpoint

func MakeLogoutEndpoint(s webapi.Service) endpoint.Endpoint

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

func MakeSignUpEndpoint

func MakeSignUpEndpoint(s webapi.Service) endpoint.Endpoint

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

Types

type AddEventRequest

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

AddEventRequest -> CreateEvent endpoint's input structures

type AddEventResponse

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

AddEventResponse -> CreateEvent endpoint's output structure

type DeleteEventRequest

type DeleteEventRequest struct {
	EventId string `json:"eventId,omitempty"`
	UserId  uint64 `json:"userId"`
}

DeleteEventRequest -> CreateEvent endpoint's input structures

type DeleteEventResponse

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

DeleteEventResponse -> CreateEvent endpoint's output structure

type ListEventRequest

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

ListEventRequest -> CreateEvent endpoint's input structures

type ListEventResponse

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

ListEventResponse -> CreateEvent endpoint's output structure

type LoginRequest

type LoginRequest struct {
	User repo.User `json:"user"`
}

LoginRequest -> CreateEvent endpoint's input structures

type LoginResponse

type LoginResponse struct {
	UserId uint64      `json:"userId,omitempty"`
	Token  token.Token `json:"token,omitempty"`
	Err    string      `json:"err,omitempty"`
}

LoginResponse -> CreateEvent endpoint's output structure

type LogoutRequest

type LogoutRequest struct {
	Token token.Token `json:"token"`
}

LogoutRequest -> CreateEvent endpoint's input structures

type LogoutResponse

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

LogoutResponse -> CreateEvent endpoint's output structure

type Set

type Set struct {
	AddEventEndpoint    endpoint.Endpoint
	ListEventEndpoint   endpoint.Endpoint
	DeleteEventEndpoint endpoint.Endpoint

	SignUpEndpoint endpoint.Endpoint
	LoginEndpoint  endpoint.Endpoint
	LogoutEndpoint endpoint.Endpoint
}

func New

func New(s webapi.Service) Set

type SignUpRequest

type SignUpRequest struct {
	User repo.User `json:"user"`
}

SignUpRequest -> CreateEvent endpoint's input structures

type SignUpResponse

type SignUpResponse struct {
	UserId uint64      `json:"userId,omitempty"`
	Token  token.Token `json:"token,omitempty"`
	Err    string      `json:"err,omitempty"`
}

SignUpResponse -> CreateEvent endpoint's output structure

Jump to

Keyboard shortcuts

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