data

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MPL-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package data provides common data types for use with the employees service.

Index

Constants

View Source
const (
	RouteEmployees       string = "/api/v1/employees"
	RouteEmployeesSearch string = RouteEmployees + "/search"
	RouteEmployeesID     string = RouteEmployees + "/{id}"
	RouteEmployeesIDf    string = RouteEmployees + "/%s"
)

rest routes for employees

View Source
const (
	ParameterIDs            string = "ids"
	ParameterFirstName      string = "first_name"
	ParameterFirstNames     string = "first_names"
	ParameterLastName       string = "last_name"
	ParameterLastNames      string = "last_names"
	ParameterEmailAddress   string = "email_address"
	ParameterEmailAddresses string = "email_addresses"
)

patameters for employees service

View Source
const PathID string = "id"

Variables

View Source
var (
	ChangeTypeEmployee = "employee"
	ChangeActionCreate = "create"
	ChangeActionUpdate = "update"
	ChangeActionDelete = "delete"
)

contracts for changes

View Source
var ServiceName = "bludgeon_employees"

Functions

This section is empty.

Types

type Employee

type Employee struct {
	// The ID of an employee (v4 UUID)
	// example: 86fa2f09-d260-11ec-bd5d-0242c0a8e002
	ID string `json:"id"`

	// The first name of an employee
	// example: John
	FirstName string `json:"first_name"`

	// The last name of an employee
	// example: Smith
	LastName string `json:"last_name"`

	// The email address of an employee
	// example: John.Smith@foobar.duck
	EmailAddress string `json:"email_address"`

	//The last time (unix nano) something was mutated
	// example: 1652417242000
	LastUpdated int64 `json:"last_updated"`

	//identifies the last someone who mutated something
	// example: bludgeon_employee_memory
	LastUpdatedBy string `json:"last_updated_by"`

	//An integer that's atomically incremented each time something is mutated
	// example: 1
	Version int `json:"version"`
}

swagger:model Employee Employee represents a person uniquely identified by their email address

func (*Employee) Type added in v1.3.0

func (e *Employee) Type() string

type EmployeePartial

type EmployeePartial struct {
	//The first name of an employee, this is optional
	// example: Jane
	FirstName *string `json:"first_name,omitempty"`

	//The last name of an employee, this is optional
	// example: Doe
	LastName *string `json:"last_name,omitempty"`

	//The email address of an employee, this is optional, but can't conflict with existing employees
	// example: Jane.Doe@foobar.duck
	EmailAddress *string `json:"email_address,omitempty"`
}

swagger:model EmployeePartial EmployeePartial provides a way to optionally/partially update different fields of an employee

type EmployeeSearch

type EmployeeSearch struct {
	//An array of one or more ids to search for
	// in: query
	IDs []string `json:"ids,omitempty"`

	//A single first name to search for
	// in: query
	FirstName *string `json:"first_name,omitempty"`

	//An array of one or more first names to search for
	// in: query
	FirstNames []string `json:"first_names,omitempty"`

	//A single last name to search for
	// in: query
	LastName *string `json:"last_name,omitempty"`

	//An array of one or more first names to search for
	// in: query
	LastNames []string `json:"last_names,omitempty"`

	//A single email address to search for
	// in: query
	EmailAddress *string `json:"email_address,omitempty"`

	//An array of one or more email addresses to search for
	// in: query
	EmailAddresses []string `json:"email_addresses,omitempty"`
}

swagger:model EmployeesSearch EmployeeSearch can be used to search for an employee using one or more properties

func (*EmployeeSearch) FromParams

func (e *EmployeeSearch) FromParams(params map[string][]string)

func (*EmployeeSearch) ToParams

func (e *EmployeeSearch) ToParams() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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