job

package
v0.0.0-...-242d932 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobStatus

type JobStatus int
const (
	Created JobStatus = iota
	Waiting
	Accepted
	Rejected
	Archived
)

type Model

type Model struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	UserID      primitive.ObjectID `bson:"userID,omitempty" json:"userID"`
	Title       string             `bson:"title,omitempty" json:"title"`
	Link        string             `bson:"link" json:"link"`
	Company     string             `bson:"company" json:"company"`
	Description string             `bson:"description" json:"description"`
	CreatedAt   int64              `bson:"createdAt" json:"createdAt"`
	UpdatedAt   int64              `bson:"updatedAt" json:"updatedAt"`
	Status      JobStatus          `bson:"status" json:"status"`
}

func (*Model) Create

func (job *Model) Create() *errors.ApplicationError

func (*Model) Delete

func (job *Model) Delete() *errors.ApplicationError

func (*Model) FindAll

func (job *Model) FindAll() ([]Response, *errors.ApplicationError)

func (*Model) FindOne

func (job *Model) FindOne() (*Model, *errors.ApplicationError)

func (*Model) JobResponse

func (job *Model) JobResponse() interface{}

func (*Model) Update

func (job *Model) Update() (*Model, *errors.ApplicationError)

func (*Model) Validate

func (job *Model) Validate() *errors.ApplicationError

type Request

type Request struct {
	ID          string    `json:"id" `
	Title       string    `json:"title"`
	Company     string    `json:"company"`
	Link        string    `json:"link"`
	Description string    `json:"description"`
	Status      JobStatus `json:"status"`
}

type Response

type Response struct {
	ID          primitive.ObjectID `bson:"_id" json:"id"`
	Title       string             `bson:"title" json:"title"`
	Company     string             `bson:"company" json:"company"`
	Link        string             `bson:"link" json:"link"`
	Description string             `bson:"description" json:"description"`
	CreatedAt   int64              `bson:"createdAt" json:"createdAt"`
	UpdatedAt   int64              `bson:"updatedAt" json:"updatedAt"`
	Status      JobStatus          `bson:"status" json:"status"`
}

Jump to

Keyboard shortcuts

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