models

package
v0.0.0-...-9d13ea8 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessDetails

type AccessDetails struct {
	AccessUUID string
	UserID     int64
}

AccessDetails ...

type Article

type Article struct {
	ID        int64    `db:"id, primarykey, autoincrement" json:"id"`
	UserID    int64    `db:"user_id" json:"-"`
	Title     string   `db:"title" json:"title"`
	Content   string   `db:"content" json:"content"`
	UpdatedAt int64    `db:"updated_at" json:"updated_at"`
	CreatedAt int64    `db:"created_at" json:"created_at"`
	User      *JSONRaw `db:"user" json:"user"`
}

Article ...

type ArticleModel

type ArticleModel struct{}

ArticleModel ...

func (ArticleModel) All

func (m ArticleModel) All(userID int64) (articles []DataList, err error)

All ...

func (ArticleModel) Create

func (m ArticleModel) Create(userID int64, form forms.CreateArticleForm) (articleID int64, err error)

Create ...

func (ArticleModel) Delete

func (m ArticleModel) Delete(userID, id int64) (err error)

Delete ...

func (ArticleModel) One

func (m ArticleModel) One(userID, id int64) (article Article, err error)

One ...

func (ArticleModel) Update

func (m ArticleModel) Update(userID int64, id int64, form forms.CreateArticleForm) (err error)

Update ...

type AuthModel

type AuthModel struct{}

AuthModel ...

func (AuthModel) CreateAuth

func (m AuthModel) CreateAuth(userid int64, td *TokenDetails) error

CreateAuth ...

func (AuthModel) CreateToken

func (m AuthModel) CreateToken(userID int64) (*TokenDetails, error)

CreateToken ...

func (AuthModel) DeleteAuth

func (m AuthModel) DeleteAuth(givenUUID string) (int64, error)

DeleteAuth ...

func (AuthModel) ExtractToken

func (m AuthModel) ExtractToken(r *http.Request) string

ExtractToken ...

func (AuthModel) ExtractTokenMetadata

func (m AuthModel) ExtractTokenMetadata(r *http.Request) (*AccessDetails, error)

ExtractTokenMetadata ...

func (AuthModel) FetchAuth

func (m AuthModel) FetchAuth(authD *AccessDetails) (int64, error)

FetchAuth ...

func (AuthModel) TokenValid

func (m AuthModel) TokenValid(r *http.Request) error

TokenValid ...

func (AuthModel) VerifyToken

func (m AuthModel) VerifyToken(r *http.Request) (*jwt.Token, error)

VerifyToken ...

type ChangedHistory

type ChangedHistory struct {
	CreatedAt time.Time
	Status    string
}

type DataList

type DataList struct {
	Data JSONRaw `db:"data" json:"data"`
	Meta JSONRaw `db:"meta" json:"meta"`
}

DataList ....

type JSONRaw

type JSONRaw json.RawMessage

JSONRaw ...

func (*JSONRaw) MarshalJSON

func (j *JSONRaw) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (*JSONRaw) Scan

func (j *JSONRaw) Scan(src interface{}) error

Scan ...

func (*JSONRaw) UnmarshalJSON

func (j *JSONRaw) UnmarshalJSON(data []byte) error

UnmarshalJSON ...

func (JSONRaw) Value

func (j JSONRaw) Value() (driver.Value, error)

Value ...

type ListStrategiesByStatus

type ListStrategiesByStatus struct {
	Id      int
	Name    string
	Process *int
	Goal    string
	Label   string
}

type Poromodo

type Poromodo struct {
	Strategy struct {
		Name         string
		Label        string
		Process      int
		TimeEstimate int
		Status       string
		Goal         string
	}
	Satisfaction float64
	Productivity float64
	Interested   float64
	Insight      float64
	CreatedAt    time.Time
	Goal         string
	Duration     int
}

type PoromodoModel

type PoromodoModel struct{}

func (PoromodoModel) GetByStrategyId

func (s PoromodoModel) GetByStrategyId(id string) ([]Poromodo, error)

func (PoromodoModel) GetList

func (s PoromodoModel) GetList() ([]Poromodo, error)

func (PoromodoModel) Insert

func (p PoromodoModel) Insert(form forms.InsertPoromodoForm) (poromodoId int64, err error)

type Strategy

type Strategy struct {
	Id           int
	Goal         string
	Details      string
	Name         string
	CreatedAt    time.Time
	StartedAt    time.Time
	EndedAt      time.Time
	Label        string
	Status       string
	TimeEstimate float64
	Process      *int
	IsProduction *bool
	Satisfaction *float64
	Productivity *float64
	Interested   *float64
	Insight      *float64
}

type StrategyModel

type StrategyModel struct{}

func (StrategyModel) ChangeStatus

func (s StrategyModel) ChangeStatus(form forms.ChangeStrategyStatusForm) error

func (StrategyModel) GetDetailChangedHistory

func (s StrategyModel) GetDetailChangedHistory(id string) ([]ChangedHistory, error)

func (StrategyModel) GetList

func (s StrategyModel) GetList() ([]Strategy, error)

func (StrategyModel) GetStrategiesByStatus

func (s StrategyModel) GetStrategiesByStatus(status string) ([]ListStrategiesByStatus, error)

func (StrategyModel) Insert

func (p StrategyModel) Insert(form forms.InsertStrategyForm) (strategyId int64, err error)

func (StrategyModel) TriggerCompleted

func (s StrategyModel) TriggerCompleted(form forms.StrategyCompletedForm) error

type Token

type Token struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

Token ...

type TokenDetails

type TokenDetails struct {
	AccessToken  string
	RefreshToken string
	AccessUUID   string
	RefreshUUID  string
	AtExpires    int64
	RtExpires    int64
}

TokenDetails ...

type User

type User struct {
	ID        int64  `db:"id, primarykey, autoincrement" json:"id"`
	Email     string `db:"email" json:"email"`
	Password  string `db:"password" json:"-"`
	Name      string `db:"name" json:"name"`
	UpdatedAt int64  `db:"updated_at" json:"-"`
	CreatedAt int64  `db:"created_at" json:"-"`
}

User ...

type UserModel

type UserModel struct{}

UserModel ...

func (UserModel) Login

func (m UserModel) Login(form forms.LoginForm) (user User, token Token, err error)

Login ...

func (UserModel) One

func (m UserModel) One(userID int64) (user User, err error)

One ...

func (UserModel) Register

func (m UserModel) Register(form forms.RegisterForm) (user User, err error)

Register ...

type UserSessionInfo

type UserSessionInfo struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

UserSessionInfo ...

Jump to

Keyboard shortcuts

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