data

package
v0.0.0-...-57159d5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 19 Imported by: 0

README

Data

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is data providers.

Functions

func NewAuthRepo

func NewAuthRepo(data *Data, logger log.Logger) biz.AuthRepo

func NewCache

func NewCache(c *conf.Data) (cache *redis.Client, err error)

NewCache .

func NewCalendarRepo

func NewCalendarRepo(data *Data, logger log.Logger) biz.CalendarRepo

func NewDB

func NewDB(c *conf.Data) (db *gorm.DB, err error)

NewDB .

func NewEventHistoryRepo

func NewEventHistoryRepo(data *Data, logger log.Logger) biz.EventHistoryRepo

func NewEventRepo

func NewEventRepo(data *Data, logger log.Logger) biz.EventRepo

func NewGoogleRepo

func NewGoogleRepo(c *conf.Google, logger log.Logger) (biz.GoogleRepo, func(), error)

func NewUserRepo

func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo

Types

type Data

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

Data .

func NewData

func NewData(db *gorm.DB, cache *redis.Client, logger log.Logger) (*Data, func(), error)

NewData .

type Event

type Event struct {
	gorm.Model
	ID         uuid.UUID `gorm:"type:varchar(255);primaryKey;default:gen_random_uuid()"`
	CalendarID uuid.UUID
	GoogleID   string
	Title      string
	Location   string
	StartTime  time.Time
	EndTime    time.Time
	IsUsed     bool
	IsAllDay   bool
	History    []*eventHistory
}

type User

type User struct {
	gorm.Model
	ID           uuid.UUID `gorm:"column:id;primaryKey;type:uuid;default:gen_random_uuid()" json:"id"`
	GoogleID     string
	TGID         string
	Name         string
	Email        string
	RefreshToken string
	Calendars    []*calendar
}

type UserRepo

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

func (*UserRepo) Create

func (r *UserRepo) Create(_ context.Context, user *biz.User) error

func (*UserRepo) Get

func (r *UserRepo) Get(_ context.Context, user *biz.User) (*biz.User, error)

Get gets user from database by id or email

func (*UserRepo) List

func (r *UserRepo) List(_ context.Context) ([]*biz.User, error)

List lists all users from database

type Users

type Users []*User

Jump to

Keyboard shortcuts

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