employees

package
v0.0.0-...-e4c3b48 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEmployee

func CreateEmployee(conn *pgxpool.Pool) func(ctx context.Context, input *EmployeeInput) (*EmployeeOutput, error)

func GetEmployeeById

func GetEmployeeById(conn *pgxpool.Pool) func(ctx context.Context, input *struct {
	ID int `path:"id"`
}) (*EmployeeOutput, error)

func GetEmployees

func GetEmployees(conn *pgxpool.Pool) func(ctx context.Context, input *EmployeesInput) (*EmployeesOutput, error)

Types

type Employee

type Employee struct {
	ID        int       `json:"id"`
	FirstName string    `json:"first_name"`
	LastName  string    `json:"last_name"`
	Email     string    `json:"email"`
	Age       int       `json:"age"`
	CreatedAt time.Time `json:"created_at"`
}

type EmployeeInput

type EmployeeInput struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Email     string `json:"email"`
	Age       int    `json:"age"`
}

type EmployeeOutput

type EmployeeOutput struct {
	Body Employee `json:"body"`
}

type EmployeesInput

type EmployeesInput struct {
	Session http.Cookie `cookie:"session_token"` // Use the correct cookie name here
}

type EmployeesOutput

type EmployeesOutput struct {
	Body struct {
		Employees []Employee `json:"employees"`
	}
}

Jump to

Keyboard shortcuts

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