talent

package
v0.0.0-...-a206de7 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MongoDatabase   = "crewdotwork"
	MongoCollection = "talents"
)

Functions

func FindAllHandler

func FindAllHandler(store Store) func(w http.ResponseWriter, r *http.Request)

func InsertOneHandler

func InsertOneHandler(store Store) func(w http.ResponseWriter, r *http.Request)

func Validate

func Validate(talent Talent) error

Types

type InsertTalendResponse

type InsertTalendResponse struct {
	ID primitive.ObjectID `json:"id"`
}

type MemStore

type MemStore struct {
	Talents []Talent
}

func (*MemStore) Drop

func (store *MemStore) Drop() error

func (*MemStore) FindAll

func (store *MemStore) FindAll(limit int64, page int64) ([]Talent, error)

func (*MemStore) Insert

func (store *MemStore) Insert(model *Talent) error

type MongoStore

type MongoStore struct {
	Uri     string
	Timeout time.Duration
}

func (*MongoStore) Drop

func (store *MongoStore) Drop() error

func (*MongoStore) FindAll

func (store *MongoStore) FindAll(limit int64, page int64) ([]Talent, error)

func (*MongoStore) Insert

func (store *MongoStore) Insert(model *Talent) error

type Store

type Store interface {
	Insert(model *Talent) error
	FindAll(limit int64, page int64) ([]Talent, error)
	Drop() error
}

type Talent

type Talent struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	FirstName string             `bson:"firstName"     json:"firstName"`
	LastName  string             `bson:"lastName"      json:"lastName"`
	Picture   string             `bson:"picture"       json:"picture"`
	Job       string             `bson:"job"           json:"job"`
	Location  string             `bson:"location"      json:"location"`
	Linkedin  string             `bson:"linkedin"      json:"linkedin"`
	Github    string             `bson:"github"        json:"github"`
	Tags      []string           `bson:"tags"          json:"tags"`
	Stage     string             `bson:"stage"         json:"stage"`
}

Jump to

Keyboard shortcuts

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