models

package
v0.0.0-...-0716d42 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRefreshToken

func GetRefreshToken(ctx context.Context, db *redis.Client, userId string) (string, error)

Types

type PublicUser

type PublicUser struct {
	Id       string `json:"id"`
	Href     string `json:"href"`
	Username string `json:"username"`
	Name     string `json:"name"`
	Bio      string `json:"bio"`
}

type Session

type Session struct {
	AccessToken string       `json:"access_token"`
	User        *SessionUser `json:"user"`
	// contains filtered or unexported fields
}

func NewSession

func NewSession(db *redis.Client, accessToken string, user *SessionUser) *Session

func (*Session) Delete

func (s *Session) Delete(ctx context.Context, c echo.Context) error

func (*Session) Save

func (s *Session) Save(ctx context.Context, c echo.Context, refreshToken string) error

type SessionUser

type SessionUser struct {
	*User
	Roles   []string `json:"roles"`
	IsAdmin bool     `json:"isAdmin"`
}

type Task

type Task struct {
	Id          string      `json:"id"`
	Href        string      `json:"href"`
	CreatedAt   *time.Time  `json:"created_at"`
	CreatedBy   *PublicUser `json:"created_by"`
	UpdatedAt   *time.Time  `json:"updated_at"`
	UpdatedBy   *PublicUser `json:"updated_by"`
	Completed   bool        `json:"completed"`
	CompletedAt *time.Time  `json:"completed_at"`
	CompletedBy *PublicUser `json:"completed_by"`
	Title       string      `json:"title"`
}

type User

type User struct {
	Id        string     `json:"id"`
	Href      string     `json:"href"`
	Username  string     `json:"username"`
	Email     string     `json:"email"`
	Name      string     `json:"name"`
	Bio       string     `json:"bio"`
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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