Documentation ¶
Index ¶
- func ContactsServiceCreateHandlerFunc(env *connectors.Env) http.HandlerFunc
- func ContactsServiceDeleteBulkHandlerFunc() http.HandlerFunc
- func ContactsServiceGetBunchHandlerFunc() http.HandlerFunc
- func ContactsServiceGetByDateHandlerFunc() http.HandlerFunc
- func ContactsServiceGetOneHandlerFunc() http.HandlerFunc
- func ContactsServiceReplaceHandlerFunc() http.HandlerFunc
- func ContactsServiceUpdateHandlerFunc(env *connectors.Env) http.HandlerFunc
- func DoodadsServiceCreateHandlerFunc(env *connectors.Env) http.HandlerFunc
- func EchoHandlerFunc(env *connectors.Env) http.HandlerFunc
- func NewRouter(env *connectors.Env) *chi.Mux
- func ParseInt64(strings []string) ([]int64, error)
- func ParseTime(ts, format string) (*time.Time, error)
- func PingHandlerFunc(env *connectors.Env) http.HandlerFunc
- func ThingsServiceCreateHandlerFunc() http.HandlerFunc
- func ThingsServiceDeleteHandlerFunc() http.HandlerFunc
- func ThingsServiceGetByCategoryAndQueryHandlerFunc() http.HandlerFunc
- func ThingsServiceGetByDateRangeHandlerFunc() http.HandlerFunc
- type EchoResponse
- type ThingListResponse
- type ThingsService
- func (cs ThingsService) Create(ctx context.Context, req models.ThingRequest) (*models.ThingResponse, error)
- func (cs *ThingsService) Delete(id int) error
- func (cs ThingsService) GetByCategoryAndQuery(ctx context.Context, category string, q string) (ThingListResponse, error)
- func (cs ThingsService) GetByDateRange(ctx context.Context, from, to *time.Time) (ThingListResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContactsServiceCreateHandlerFunc ¶
func ContactsServiceCreateHandlerFunc(env *connectors.Env) http.HandlerFunc
ContactsServiceCreateHandlerFunc handles requests to: path : /contacts method: post Create a new contact request entity.
func ContactsServiceDeleteBulkHandlerFunc ¶ added in v0.1.5
func ContactsServiceDeleteBulkHandlerFunc() http.HandlerFunc
ContactsServiceDeleteBulkHandlerFunc handles requests to: path : /contacts method: delete DeleteBulk contact by id
func ContactsServiceGetBunchHandlerFunc ¶ added in v0.4.2
func ContactsServiceGetBunchHandlerFunc() http.HandlerFunc
ContactsServiceGetBunchHandlerFunc handles requests to: path : /contacts method: get GetBunch of contacts by ids @summary Get a list of contacts by ids @description Get a list of contacts by ids @tags contacts @produces application/json @parameters {"name":"ids", "description":"list of contact ids", "required":true} @responses.400 {models.ErrorResponse}
func ContactsServiceGetByDateHandlerFunc ¶
func ContactsServiceGetByDateHandlerFunc() http.HandlerFunc
ContactsServiceGetByDateHandlerFunc handles requests to: path : /contacts/{month}-{day}-{year} method: get Get contacts list by date
func ContactsServiceGetOneHandlerFunc ¶
func ContactsServiceGetOneHandlerFunc() http.HandlerFunc
ContactsServiceGetOneHandlerFunc handles requests to: path : /contacts/{id} method: get GetOne contact by id id contact id
func ContactsServiceReplaceHandlerFunc ¶
func ContactsServiceReplaceHandlerFunc() http.HandlerFunc
ContactsServiceReplaceHandlerFunc handles requests to: path : /contacts/{id} method: put Replace a contact entity completely.
func ContactsServiceUpdateHandlerFunc ¶
func ContactsServiceUpdateHandlerFunc(env *connectors.Env) http.HandlerFunc
ContactsServiceUpdateHandlerFunc handles requests to: path : /contacts/{id} method: post Update a contact entity with provided data.
func DoodadsServiceCreateHandlerFunc ¶ added in v0.1.6
func DoodadsServiceCreateHandlerFunc(env *connectors.Env) http.HandlerFunc
DoodadsServiceCreateHandlerFunc handles requests to: path : /doodads method: post Create a new doodad entity.
func EchoHandlerFunc ¶
func EchoHandlerFunc(env *connectors.Env) http.HandlerFunc
EchoHandlerFunc handles requests to: path : /echo/{input} method: get Echo returns body with 'i's replaced with 'o's
func NewRouter ¶
func NewRouter(env *connectors.Env) *chi.Mux
NewRouter returns a router configured with endpoints and handlers.
@swagger 2.0 @info.title Example OpenAPI Version 2 Specification @info.version 1.0.0 @info.description Example OpenAPI Version 2 Specification @info.termsOfService http://swagger.io/terms/ @info.contact.name API Support @info.contact.url http://www.swagger.io/support @info.contact.email support@swagger.io
@info.license { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }
@schemes ["http", "https"] @host api.example.com @basePath /api @consumes application/json @produces application/json @produces application/text
@securityDefinitions.token { "description": "Requests should pass a token.", "type": "token", "name": "X-TOKEN", "in": "header" }
@security [{"token": []}] @externalDocs.description OpenAPI @externalDocs.url https://swagger.io/resources/open-api/
func ParseInt64 ¶ added in v0.4.2
func PingHandlerFunc ¶ added in v0.1.7
func PingHandlerFunc(env *connectors.Env) http.HandlerFunc
PingHandlerFunc handles requests to: path : /ping method: post Ping returns body with 'i's replaced with 'o's
func ThingsServiceCreateHandlerFunc ¶ added in v0.1.7
func ThingsServiceCreateHandlerFunc() http.HandlerFunc
ThingsServiceCreateHandlerFunc handles requests to: path : /things method: post Create thing
func ThingsServiceDeleteHandlerFunc ¶
func ThingsServiceDeleteHandlerFunc() http.HandlerFunc
ThingsServiceDeleteHandlerFunc handles requests to: path : /things/{id} method: delete Delete thing by id
func ThingsServiceGetByCategoryAndQueryHandlerFunc ¶
func ThingsServiceGetByCategoryAndQueryHandlerFunc() http.HandlerFunc
ThingsServiceGetByCategoryAndQueryHandlerFunc handles requests to: path : /things/{category} method: get Get things by category and search query @parameters {"name":"category", "description": "category of data to search"} @parameters {"name":"q", "description": "search query"}
func ThingsServiceGetByDateRangeHandlerFunc ¶ added in v0.1.4
func ThingsServiceGetByDateRangeHandlerFunc() http.HandlerFunc
ThingsServiceGetByDateRangeHandlerFunc handles requests to: path : /things method: get Get things by date range @description A long description of this endpoint @summary A short summary of this endpoint @operationId GetThingsByDateRange @consumes application/json @produces application/json @produces plain/text @tags ["things", "example", "get"] @parameters {"name":"from", "format":"date-time,2006-01-02", "description": "date should be in Go time format"} @parameters {"name":"to", "format":"date-time,2006-01-02", "description": "date should be in Go time format"} @parameters {"name":"notgood", "description": "parameter not found in code, tsk tsk", "in": "path", "type": "string", "format": "eMail"} @responses.400 {models.ErrorResponse} @responses.404 {models.ErrorResponse}
Types ¶
type ThingListResponse ¶ added in v0.1.3
type ThingListResponse struct {
Things []models.ThingResponse `json:"things"`
}
List of things
type ThingsService ¶
type ThingsService struct {
DataConnector *connectors.DataConnector
}
func InitThingsService ¶
func InitThingsService() (*ThingsService, error)
func (ThingsService) Create ¶ added in v0.1.7
func (cs ThingsService) Create(ctx context.Context, req models.ThingRequest) (*models.ThingResponse, error)
Create thing
func (ThingsService) GetByCategoryAndQuery ¶
func (cs ThingsService) GetByCategoryAndQuery(ctx context.Context, category string, q string) (ThingListResponse, error)
Get things by category and search query
@parameters {"name":"category", "description": "category of data to search"} @parameters {"name":"q", "description": "search query"}
func (ThingsService) GetByDateRange ¶ added in v0.1.4
func (cs ThingsService) GetByDateRange(ctx context.Context, from, to *time.Time) (ThingListResponse, error)
Get things by date range
@description A long description of this endpoint @summary A short summary of this endpoint @operationId GetThingsByDateRange @consumes application/json @produces application/json @produces plain/text @tags ["things", "example", "get"] @parameters {"name":"from", "format":"date-time,2006-01-02", "description": "date should be in Go time format"} @parameters {"name":"to", "format":"date-time,2006-01-02", "description": "date should be in Go time format"} @parameters {"name":"notgood", "description": "parameter not found in code, tsk tsk", "in": "path", "type": "string", "format": "eMail"} @responses.400 {models.ErrorResponse} @responses.404 {models.ErrorResponse}