data

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RouteEmployees       string = "/employees"
	RouteEmployeesSearch string = RouteEmployees + "/search"
	RouteEmployeesEmpNo  string = RouteEmployees + "/{" + PathEmpNo + "}"
	RouteEmployeesEmpNof string = RouteEmployees + "/%d"
)
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

This section is empty.

Types

type Employee

type Employee struct {
	EmpNo     int64  `json:"emp_no"` //this is actually an int32, but the types are compatible
	BirthDate int64  `json:"birth_date"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Gender    string `json:"gender"` //this is actually an enum, but not worth the effort
	HireDate  int64  `json:"hire_date"`
}

func (*Employee) MarshalBinary

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

func (*Employee) UnmarshalBinary

func (e *Employee) UnmarshalBinary(data []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"` //this is actually an enum, but not worth the effort
	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) ToParams

func (e *EmployeeSearch) ToParams() url.Values

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"`
}

Jump to

Keyboard shortcuts

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