model

package
v0.0.0-...-e311c1c Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opening

type Opening struct {
	gorm.Model
	Role     string
	Company  string
	Location string
	Remote   bool
	Link     string
	Salary   int64
}

func (*Opening) ToResponse

func (o *Opening) ToResponse() *OpeningResponse

type OpeningRequest

type OpeningRequest struct {
	Role     string `json:"role" example:"Software Engineer"`
	Company  string `json:"company" example:"Google"`
	Location string `json:"location" example:"Remote"`
	Remote   *bool  `json:"remote" example:"true"`
	Link     string `json:"link" example:"https://google.com"`
	Salary   int64  `json:"salary" example:"100000"`
}

func (*OpeningRequest) ToOpening

func (o *OpeningRequest) ToOpening() *Opening

func (*OpeningRequest) ValidateCreation

func (o *OpeningRequest) ValidateCreation() error

ValidateCreation validates the request body for creating a new opening

func (*OpeningRequest) ValidateUpdate

func (o *OpeningRequest) ValidateUpdate() error

ValidateUpdate validates the request body for updating an existing opening

type OpeningResponse

type OpeningResponse struct {
	ID        uint      `json:"id" example:"1"`
	CreatedAt time.Time `json:"createdAt" example:"2021-01-01T00:00:00Z"`
	UpdatedAt time.Time `json:"updatedAt" example:"2021-01-01T00:00:00Z"`
	DeletedAt time.Time `json:"deletedAt,omitempty" example:"2021-01-01T00:00:00Z"`
	Role      string    `json:"role" example:"Software Engineer"`
	Company   string    `json:"company" example:"Google"`
	Location  string    `json:"location" example:"Remote"`
	Remote    bool      `json:"remote" example:"true"`
	Link      string    `json:"link" example:"https://google.com"`
	Salary    int64     `json:"salary" example:"100000"`
}

Jump to

Keyboard shortcuts

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