data

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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 (
	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 NewError added in v1.1.0

func NewError(err any, errorTypes ...ErrorType) error

func NewNotCachedError added in v1.1.0

func NewNotCachedError(item any) error

func NewNotCachedRetryError added in v1.1.0

func NewNotCachedRetryError(item any) error

func NewNotFoundError added in v1.1.0

func NewNotFoundError(item any) error

func NewUnknownError added in v1.1.0

func NewUnknownError(item any) error

Types

type CacheCounters added in v1.1.0

type CacheCounters struct {
	CounterHits   map[string]int `json:"counter_hits,omitempty"`
	CounterMisses map[string]int `json:"counter_misses,omitempty"`
}

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 (e *Employee) MarshalBinary() ([]byte, error)

func (*Employee) UnmarshalBinary

func (e *Employee) UnmarshalBinary(bytes []byte) error

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) Error added in v1.1.0

func (e *Error) Error() string

func (*Error) Is added in v1.1.0

func (e *Error) Is(err error) bool

func (*Error) MarshalBinary added in v1.1.0

func (e *Error) MarshalBinary() ([]byte, error)

func (*Error) Type added in v1.1.0

func (e *Error) Type() string

func (*Error) UnmarshalBinary added in v1.1.0

func (e *Error) UnmarshalBinary(bytes []byte) error

type ErrorType added in v1.1.0

type ErrorType string
const (
	ErrorTypeUnknown        ErrorType = "ERR_UNKNOWN"
	ErrorTypeNotFound       ErrorType = "ERR_NOT_FOUND"
	ErrorTypeNotCached      ErrorType = "ERR_NOT_CACHED"
	ErrorTypeNotCachedRetry ErrorType = "ERR_NOT_CACHED_RETRY"
)

func (ErrorType) StatusCode added in v1.1.0

func (e ErrorType) StatusCode() int

type Request

type Request struct {
	EmployeePartial EmployeePartial `json:"employee_partial"`
}

type Response

type Response struct {
	Employee  *Employee   `json:"employee,omitempty"`
	Employees []*Employee `json:"employees,omitempty"`
}

type Sleep added in v1.1.0

type Sleep struct {
	Id       string `json:"sleep_id"`
	Duration int64  `json:"sleep_duration,string"`
}

func (*Sleep) MarshalBinary added in v1.1.0

func (s *Sleep) MarshalBinary() ([]byte, error)

func (*Sleep) UnmarshalBinary added in v1.1.0

func (s *Sleep) UnmarshalBinary(bytes []byte) error

type Timers added in v1.1.0

type Timers struct {
	Totals   map[string]int64 `json:"totals,omitempty"`
	Averages map[string]int64 `json:"averages,omitempty"`
}

Jump to

Keyboard shortcuts

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