Documentation ¶
Index ¶
- Variables
- func AssertLocationDetailsRequired(obj LocationDetails) error
- func AssertLocationResponseRequired(obj LocationResponse) error
- func AssertRecurseInterfaceRequired(obj interface{}, callback func(interface{}) error) error
- func AssertRecurseLocationDetailsRequired(objSlice interface{}) error
- func AssertRecurseLocationResponseRequired(objSlice interface{}) error
- func AssertRecurseSubIdsRequired(objSlice interface{}) error
- func AssertRecurseValueRequired(value reflect.Value, callback func(interface{}) error) error
- func AssertSubIdsRequired(obj SubIds) error
- func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
- func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
- func IsZeroValue(val interface{}) bool
- func Logger(inner http.Handler, name string) http.Handler
- func NewRouter(routers ...Router) *mux.Router
- func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)
- func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)
- type ErrorHandler
- type ImplResponse
- type LocationApiController
- type LocationApiOption
- type LocationApiRouter
- type LocationApiService
- type LocationApiServicer
- type LocationDetails
- type LocationResponse
- type ParsingError
- type RecordCRUDApiController
- type RecordCRUDApiOption
- type RecordCRUDApiRouter
- type RecordCRUDApiService
- type RecordCRUDApiServicer
- type RequiredError
- type Route
- type Router
- func NewLocationApiController(s LocationApiServicer, opts ...LocationApiOption) Router
- func NewRecordCRUDApiController(s RecordCRUDApiServicer, opts ...RecordCRUDApiOption) Router
- func NewSubscriberApiController(s SubscriberApiServicer, opts ...SubscriberApiOption) Router
- func NewUeIdCRUDApiController(s UeIdCRUDApiServicer, opts ...UeIdCRUDApiOption) Router
- type Routes
- type SubIds
- type SubscriberApiController
- type SubscriberApiOption
- type SubscriberApiRouter
- type SubscriberApiService
- type SubscriberApiServicer
- type UeIdCRUDApiController
- type UeIdCRUDApiOption
- type UeIdCRUDApiRouter
- type UeIdCRUDApiService
- type UeIdCRUDApiServicer
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTypeAssertionError is thrown when type an interface does not match the asserted type ErrTypeAssertionError = errors.New("unable to assert type") )
Functions ¶
func AssertLocationDetailsRequired ¶
func AssertLocationDetailsRequired(obj LocationDetails) error
AssertLocationDetailsRequired checks if the required fields are not zero-ed
func AssertLocationResponseRequired ¶
func AssertLocationResponseRequired(obj LocationResponse) error
AssertLocationResponseRequired checks if the required fields are not zero-ed
func AssertRecurseInterfaceRequired ¶
AssertInterfaceRequired recursively checks each struct in a slice against the callback. This method traverse nested slices in a preorder fashion.
func AssertRecurseLocationDetailsRequired ¶
func AssertRecurseLocationDetailsRequired(objSlice interface{}) error
AssertRecurseLocationDetailsRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of LocationDetails (e.g. [][]LocationDetails), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseLocationResponseRequired ¶
func AssertRecurseLocationResponseRequired(objSlice interface{}) error
AssertRecurseLocationResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of LocationResponse (e.g. [][]LocationResponse), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseSubIdsRequired ¶
func AssertRecurseSubIdsRequired(objSlice interface{}) error
AssertRecurseSubIdsRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of SubIds (e.g. [][]SubIds), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseValueRequired ¶
AssertNestedValueRequired checks each struct in the nested slice against the callback. This method traverse nested slices in a preorder fashion.
func AssertSubIdsRequired ¶
AssertSubIdsRequired checks if the required fields are not zero-ed
func DefaultErrorHandler ¶
func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used.
func EncodeJSONResponse ¶
func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
func IsZeroValue ¶
func IsZeroValue(val interface{}) bool
IsZeroValue checks if the val is the zero-ed value.
func ReadFormFileToTempFile ¶
ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file
Types ¶
type ErrorHandler ¶
type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
ErrorHandler defines the required method for handling error. You may implement it and inject this into a controller if you would like errors to be handled differently from the DefaultErrorHandler
type ImplResponse ¶
type ImplResponse struct { Code int Body interface{} }
Implementation response defines an error code with the associated body
func Response ¶
func Response(code int, body interface{}) ImplResponse
Response return a ImplResponse struct filled
type LocationApiController ¶
type LocationApiController struct {
// contains filtered or unexported fields
}
LocationApiController binds http requests to an api service and writes the service results to the http response
func (*LocationApiController) GetSubIdLocation ¶
func (c *LocationApiController) GetSubIdLocation(w http.ResponseWriter, r *http.Request)
GetSubIdLocation - Get last reported location
func (*LocationApiController) Routes ¶
func (c *LocationApiController) Routes() Routes
Routes returns all of the api route for the LocationApiController
type LocationApiOption ¶
type LocationApiOption func(*LocationApiController)
LocationApiOption for how the controller is set up.
func WithLocationApiErrorHandler ¶
func WithLocationApiErrorHandler(h ErrorHandler) LocationApiOption
WithLocationApiErrorHandler inject ErrorHandler into controller
type LocationApiRouter ¶
type LocationApiRouter interface {
GetSubIdLocation(http.ResponseWriter, *http.Request)
}
LocationApiRouter defines the required methods for binding the api requests to a responses for the LocationApi The LocationApiRouter implementation should parse necessary information from the http request, pass the data to a LocationApiServicer to perform the required actions, then write the service results to the http response.
type LocationApiService ¶
type LocationApiService struct { }
LocationApiService is a service that implements the logic for the LocationApiServicer This service should implement the business logic for every endpoint for the LocationApi API. Include any external packages or services that will be required by this service.
func (*LocationApiService) GetSubIdLocation ¶
func (s *LocationApiService) GetSubIdLocation(ctx context.Context, subId string) (ImplResponse, error)
GetSubIdLocation - Get last reported location
type LocationApiServicer ¶
type LocationApiServicer interface {
GetSubIdLocation(context.Context, string) (ImplResponse, error)
}
LocationApiServicer defines the api actions for the LocationApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
func NewLocationApiService ¶
func NewLocationApiService() LocationApiServicer
NewLocationApiService creates a default api service
type LocationDetails ¶
type LocationResponse ¶
type LocationResponse struct { EventTime time.Time `json:"eventTime,omitempty"` Id string `json:"id,omitempty"` LocationInfo LocationDetails `json:"locationInfo,omitempty"` }
type ParsingError ¶
type ParsingError struct {
Err error
}
ParsingError indicates that an error has occurred when parsing request parameters
func (*ParsingError) Error ¶
func (e *ParsingError) Error() string
func (*ParsingError) Unwrap ¶
func (e *ParsingError) Unwrap() error
type RecordCRUDApiController ¶
type RecordCRUDApiController struct {
// contains filtered or unexported fields
}
RecordCRUDApiController binds http requests to an api service and writes the service results to the http response
func (*RecordCRUDApiController) DeleteCorrelation ¶
func (c *RecordCRUDApiController) DeleteCorrelation(w http.ResponseWriter, r *http.Request)
DeleteCorrelation - Delete a Record with an user provided RecordId
func (*RecordCRUDApiController) Routes ¶
func (c *RecordCRUDApiController) Routes() Routes
Routes returns all of the api route for the RecordCRUDApiController
type RecordCRUDApiOption ¶
type RecordCRUDApiOption func(*RecordCRUDApiController)
RecordCRUDApiOption for how the controller is set up.
func WithRecordCRUDApiErrorHandler ¶
func WithRecordCRUDApiErrorHandler(h ErrorHandler) RecordCRUDApiOption
WithRecordCRUDApiErrorHandler inject ErrorHandler into controller
type RecordCRUDApiRouter ¶
type RecordCRUDApiRouter interface {
DeleteCorrelation(http.ResponseWriter, *http.Request)
}
RecordCRUDApiRouter defines the required methods for binding the api requests to a responses for the RecordCRUDApi The RecordCRUDApiRouter implementation should parse necessary information from the http request, pass the data to a RecordCRUDApiServicer to perform the required actions, then write the service results to the http response.
type RecordCRUDApiService ¶
type RecordCRUDApiService struct { }
RecordCRUDApiService is a service that implements the logic for the RecordCRUDApiServicer This service should implement the business logic for every endpoint for the RecordCRUDApi API. Include any external packages or services that will be required by this service.
func (*RecordCRUDApiService) DeleteCorrelation ¶
func (s *RecordCRUDApiService) DeleteCorrelation(ctx context.Context, ueId string, subIds []string) (ImplResponse, error)
DeleteCorrelation - Delete a Record with an user provided RecordId
type RecordCRUDApiServicer ¶
type RecordCRUDApiServicer interface {
DeleteCorrelation(context.Context, string, []string) (ImplResponse, error)
}
RecordCRUDApiServicer defines the api actions for the RecordCRUDApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
func NewRecordCRUDApiService ¶
func NewRecordCRUDApiService() RecordCRUDApiServicer
NewRecordCRUDApiService creates a default api service
type RequiredError ¶
type RequiredError struct {
Field string
}
RequiredError indicates that an error has occurred when parsing request parameters
func (*RequiredError) Error ¶
func (e *RequiredError) Error() string
type Route ¶
type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc }
A Route defines the parameters for an api endpoint
type Router ¶
type Router interface {
Routes() Routes
}
Router defines the required methods for retrieving api routes
func NewLocationApiController ¶
func NewLocationApiController(s LocationApiServicer, opts ...LocationApiOption) Router
NewLocationApiController creates a default api controller
func NewRecordCRUDApiController ¶
func NewRecordCRUDApiController(s RecordCRUDApiServicer, opts ...RecordCRUDApiOption) Router
NewRecordCRUDApiController creates a default api controller
func NewSubscriberApiController ¶
func NewSubscriberApiController(s SubscriberApiServicer, opts ...SubscriberApiOption) Router
NewSubscriberApiController creates a default api controller
func NewUeIdCRUDApiController ¶
func NewUeIdCRUDApiController(s UeIdCRUDApiServicer, opts ...UeIdCRUDApiOption) Router
NewUeIdCRUDApiController creates a default api controller
type SubscriberApiController ¶
type SubscriberApiController struct {
// contains filtered or unexported fields
}
SubscriberApiController binds http requests to an api service and writes the service results to the http response
func (*SubscriberApiController) GetSubIdLocation ¶
func (c *SubscriberApiController) GetSubIdLocation(w http.ResponseWriter, r *http.Request)
GetSubIdLocation - Get last reported location
func (*SubscriberApiController) Routes ¶
func (c *SubscriberApiController) Routes() Routes
Routes returns all of the api route for the SubscriberApiController
type SubscriberApiOption ¶
type SubscriberApiOption func(*SubscriberApiController)
SubscriberApiOption for how the controller is set up.
func WithSubscriberApiErrorHandler ¶
func WithSubscriberApiErrorHandler(h ErrorHandler) SubscriberApiOption
WithSubscriberApiErrorHandler inject ErrorHandler into controller
type SubscriberApiRouter ¶
type SubscriberApiRouter interface {
GetSubIdLocation(http.ResponseWriter, *http.Request)
}
SubscriberApiRouter defines the required methods for binding the api requests to a responses for the SubscriberApi The SubscriberApiRouter implementation should parse necessary information from the http request, pass the data to a SubscriberApiServicer to perform the required actions, then write the service results to the http response.
type SubscriberApiService ¶
type SubscriberApiService struct { }
SubscriberApiService is a service that implements the logic for the SubscriberApiServicer This service should implement the business logic for every endpoint for the SubscriberApi API. Include any external packages or services that will be required by this service.
func (*SubscriberApiService) GetSubIdLocation ¶
func (s *SubscriberApiService) GetSubIdLocation(ctx context.Context, subId string) (ImplResponse, error)
GetSubIdLocation - Get last reported location
type SubscriberApiServicer ¶
type SubscriberApiServicer interface {
GetSubIdLocation(context.Context, string) (ImplResponse, error)
}
SubscriberApiServicer defines the api actions for the SubscriberApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
func NewSubscriberApiService ¶
func NewSubscriberApiService() SubscriberApiServicer
NewSubscriberApiService creates a default api service
type UeIdCRUDApiController ¶
type UeIdCRUDApiController struct {
// contains filtered or unexported fields
}
UeIdCRUDApiController binds http requests to an api service and writes the service results to the http response
func (*UeIdCRUDApiController) CreateOrModifyCorrelation ¶
func (c *UeIdCRUDApiController) CreateOrModifyCorrelation(w http.ResponseWriter, r *http.Request)
CreateOrModifyCorrelation - Create/Modify correlation between ueId and subIDs
func (*UeIdCRUDApiController) Routes ¶
func (c *UeIdCRUDApiController) Routes() Routes
Routes returns all of the api route for the UeIdCRUDApiController
type UeIdCRUDApiOption ¶
type UeIdCRUDApiOption func(*UeIdCRUDApiController)
UeIdCRUDApiOption for how the controller is set up.
func WithUeIdCRUDApiErrorHandler ¶
func WithUeIdCRUDApiErrorHandler(h ErrorHandler) UeIdCRUDApiOption
WithUeIdCRUDApiErrorHandler inject ErrorHandler into controller
type UeIdCRUDApiRouter ¶
type UeIdCRUDApiRouter interface {
CreateOrModifyCorrelation(http.ResponseWriter, *http.Request)
}
UeIdCRUDApiRouter defines the required methods for binding the api requests to a responses for the UeIdCRUDApi The UeIdCRUDApiRouter implementation should parse necessary information from the http request, pass the data to a UeIdCRUDApiServicer to perform the required actions, then write the service results to the http response.
type UeIdCRUDApiService ¶
type UeIdCRUDApiService struct { }
UeIdCRUDApiService is a service that implements the logic for the UeIdCRUDApiServicer This service should implement the business logic for every endpoint for the UeIdCRUDApi API. Include any external packages or services that will be required by this service.
func (*UeIdCRUDApiService) CreateOrModifyCorrelation ¶
func (s *UeIdCRUDApiService) CreateOrModifyCorrelation(ctx context.Context, ueId string, subIds SubIds) (ImplResponse, error)
CreateOrModifyCorrelation - Create/Modify correlation between ueId and subIDs
type UeIdCRUDApiServicer ¶
type UeIdCRUDApiServicer interface {
CreateOrModifyCorrelation(context.Context, string, SubIds) (ImplResponse, error)
}
UeIdCRUDApiServicer defines the api actions for the UeIdCRUDApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
func NewUeIdCRUDApiService ¶
func NewUeIdCRUDApiService() UeIdCRUDApiServicer
NewUeIdCRUDApiService creates a default api service