persistence

package
v0.0.0-...-2d663d2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletePerson

func DeletePerson(id int64) error

func DeletePersonAchievement

func DeletePersonAchievement(personAchievementId int64) (err error)

func DeletePersonAchievements

func DeletePersonAchievements(personId int64) (err error)

func DeletePersonExpertise

func DeletePersonExpertise(personExpertiseId int64) (err error)

func DeletePersonExpertises

func DeletePersonExpertises(personId int64) (err error)

func DeletePersonPosition

func DeletePersonPosition(personPositionId int64) (err error)

func DeletePersonPositions

func DeletePersonPositions(personId int64) (err error)

func DeletePersonSkill

func DeletePersonSkill(personSkillId int64) (err error)

func DeletePersonSkills

func DeletePersonSkills(personId int64) (err error)

func GetPersonImage

func GetPersonImage(personId int64) ([]byte, error)

func UploadPersonImage

func UploadPersonImage(personId int64, file multipart.File) error

Types

type ClientUploader

type ClientUploader struct {
	// contains filtered or unexported fields
}

type Date

type Date struct {
	Year  int
	Month int
	Day   int
}

func (Date) Format

func (date Date) Format() string

func (Date) MarshalJSON

func (date Date) MarshalJSON() ([]byte, error)

func (*Date) Parse

func (date *Date) Parse(value string) (err error)

func (*Date) Scan

func (date *Date) Scan(value interface{}) error

func (*Date) UnmarshalJSON

func (date *Date) UnmarshalJSON(b []byte) error

func (Date) Value

func (date Date) Value() (driver.Value, error)

type Dictionary

type Dictionary struct {
	Id          int64  `json:"dictId" db:"dict_id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

func CreateDictionary

func CreateDictionary(dictType string, name string, description string) (dict Dictionary, err error)

func DeleteDictionary

func DeleteDictionary(dictType string, id int64) (dict Dictionary, err error)

func GetDictionaries

func GetDictionaries(dictType string) (dicts []Dictionary, err error)

func UpdateDictionary

func UpdateDictionary(dictType string, id int64, name string, description string) (person Dictionary, err error)

type Level

type Level int
const (
	LEVEL_EXPLORER Level = 0
	LEVEL_HABITANT Level = 1
	LEVEL_GURU     Level = 2
)

type Person

type Person struct {
	Id          int64     `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

func CreatePerson

func CreatePerson(name string, description string) (person Person, err error)

func GetPerson

func GetPerson(id int64) (person Person, err error)

func GetPersons

func GetPersons() (persons []Person, err error)

func UpdatePerson

func UpdatePerson(id int64, name string, description string) (person Person, err error)

type PersonAchievement

type PersonAchievement struct {
	Id        int64  `json:"id"`
	PersionId int64  `json:"personId" db:"person_id"`
	Since     Date   `json:"since"`
	Details   string `json:"details" db:"description"`
	Dictionary
}

func AddPersonAchievement

func AddPersonAchievement(personId int64, achievementId int64, since Date, description string) (achievement PersonAchievement, err error)

func GetPersonAchievements

func GetPersonAchievements(personId int64) (achievements []PersonAchievement, err error)

func UpdatePersonAchievement

func UpdatePersonAchievement(personAchievementId int64, since Date, description string) (achievement PersonAchievement, err error)

type PersonExpertise

type PersonExpertise struct {
	Id        int64 `json:"id"`
	PersionId int64 `json:"personId" db:"person_id"`
	Since     Date  `json:"since"`
	Level     Level `json:"level"`
	Dictionary
}

func AddPersonExpertise

func AddPersonExpertise(personId int64, expertiseId int64, since Date, level Level) (expertise PersonExpertise, err error)

func GetPersonExpertises

func GetPersonExpertises(personId int64) (expertises []PersonExpertise, err error)

func UpdatePersonExpertise

func UpdatePersonExpertise(personExpertiseId int64, since Date, level Level) (expertise PersonExpertise, err error)

type PersonPosition

type PersonPosition struct {
	Id        int64  `json:"id"`
	PersionId int64  `json:"personId" db:"person_id"`
	TeamId    int64  `json:"teamId"  db:"team_id"`
	Since     Date   `json:"since"`
	Till      Date   `json:"till"`
	Details   string `json:"description" db:"description"`
	Dictionary
}

func AddPersonPosition

func AddPersonPosition(personId int64, positionId int64, teamId int64, since Date, description string) (position PersonPosition, err error)

func GetPersonPositions

func GetPersonPositions(personId int64) (positions []PersonPosition, err error)

func UpdatePersonPosition

func UpdatePersonPosition(personPositionId int64, since Date, till Date, description string) (position PersonPosition, err error)

type PersonSkill

type PersonSkill struct {
	Id        int64 `json:"id"`
	PersionId int64 `json:"personId" db:"person_id"`
	Since     Date  `json:"since"`
	Level     Level `json:"level"`
	Dictionary
}

func AddPersonSkill

func AddPersonSkill(personId int64, skillId int64, since Date, level Level) (skill PersonSkill, err error)

func GetPersonSkills

func GetPersonSkills(personId int64) (skills []PersonSkill, err error)

func UpdatePersonSkill

func UpdatePersonSkill(personSkillId int64, since Date, level Level) (skill PersonSkill, err error)

Jump to

Keyboard shortcuts

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