Documentation
¶
Index ¶
- Constants
- Variables
- func NewError(err any, errorTypes ...ErrorType) error
- func NewNotCachedError(item any) error
- func NewNotCachedRetryError(item any) error
- func NewNotFoundError(item any) error
- func NewUnknownError(item any) error
- type CacheCounters
- type Employee
- type EmployeePartial
- type EmployeeSearch
- type Error
- type ErrorType
- type Request
- type Response
- type Sleep
- type Timers
Constants ¶
View Source
const ( RouteEmployees string = "/employees" RouteEmployeesSearch string = RouteEmployees + "/search" RouteEmployeesEmpNo string = RouteEmployees + "/{" + PathEmpNo + "}" RouteEmployeesEmpNof string = RouteEmployees + "/%d" RouteCacheCounters string = "/cachecounters" RouteCache string = "/cache" RouteTimers string = "/timers" RouteSleep string = "/sleep" )
View Source
const ParameterEmpNos string = "emp_nos"
View Source
const PathEmpNo string = "EmpNo"
Variables ¶
View Source
var ( ErrUnknown error = &Error{ErrorType: ErrorTypeUnknown} ErrNotFound error = &Error{ErrorType: ErrorTypeNotFound} ErrNotCached error = &Error{ErrorType: ErrorTypeNotCached} ErrNotCachedRetry error = &Error{ErrorType: ErrorTypeNotCachedRetry} )
View Source
var ( Version string GitCommit string GitBranch string )
These variables are populated at build time REFERENCE: https://www.digitalocean.com/community/tutorials/using-ldflags-to-set-version-information-for-go-applications to find where the variables are...
go tool nm ./app | grep app
Functions ¶
func NewNotCachedError ¶ added in v1.1.0
func NewNotCachedRetryError ¶ added in v1.1.0
func NewNotFoundError ¶ added in v1.1.0
func NewUnknownError ¶ added in v1.1.0
Types ¶
type CacheCounters ¶ added in v1.1.0
type Employee ¶
type Employee struct {
EmpNo int64 `json:"emp_no"`
BirthDate int64 `json:"birth_date"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Gender string `json:"gender"`
HireDate int64 `json:"hire_date"`
}
func (*Employee) MarshalBinary ¶
func (*Employee) UnmarshalBinary ¶
type EmployeePartial ¶
type EmployeePartial struct {
BirthDate *int64 `json:"birth_date,omitempty,string"`
FirstName *string `json:"first_name,omitempty"`
LastName *string `json:"last_name,omitempty"`
Gender *string `json:"gender,omitempty"`
HireDate *int64 `json:"hire_date,omitempty,string"`
}
func (*EmployeePartial) MarshalBinary ¶
func (e *EmployeePartial) MarshalBinary() ([]byte, error)
func (*EmployeePartial) UnmarshalBinary ¶
func (e *EmployeePartial) UnmarshalBinary(data []byte) error
type EmployeeSearch ¶
type EmployeeSearch struct {
EmpNos []int64 `json:"emp_nos"`
FirstNames []string `json:"first_names"`
LastNames []string `json:"last_names"`
Gender string `json:"gender"`
}
func (*EmployeeSearch) FromParams ¶
func (e *EmployeeSearch) FromParams(params url.Values)
func (*EmployeeSearch) MarshalBinary ¶ added in v1.1.0
func (e *EmployeeSearch) MarshalBinary() ([]byte, error)
func (*EmployeeSearch) ToKey ¶ added in v1.1.0
func (e *EmployeeSearch) ToKey() (string, error)
func (*EmployeeSearch) ToParams ¶
func (e *EmployeeSearch) ToParams() url.Values
func (*EmployeeSearch) UnmarshalBinary ¶ added in v1.1.0
func (e *EmployeeSearch) UnmarshalBinary(data []byte) error
type Error ¶ added in v1.1.0
type Error struct {
// Type contains the text of the type of error
// example: not found
ErrorType `json:"error_type"`
// Error contains the text of any failed operation
// example: employee not found
ErrorMessage string `json:"error_message"`
// contains filtered or unexported fields
}
Error represents any error that can be generated by bludgeon swagger:model Error
func (*Error) MarshalBinary ¶ added in v1.1.0
func (*Error) UnmarshalBinary ¶ added in v1.1.0
type ErrorType ¶ added in v1.1.0
type ErrorType string
func (ErrorType) StatusCode ¶ added in v1.1.0
type Request ¶
type Request struct {
EmployeePartial EmployeePartial `json:"employee_partial"`
}
type Sleep ¶ added in v1.1.0
func (*Sleep) MarshalBinary ¶ added in v1.1.0
func (*Sleep) UnmarshalBinary ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.