models

package
v0.0.0-...-cf56ecf Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func DecryptAES

func DecryptAES(key []byte, ct string) string

func EncryptAES

func EncryptAES(key []byte, plaintext string) string

func InitDb

func InitDb()

func SetEncryptionKey

func SetEncryptionKey(k []byte)

Types

type Athlete

type Athlete struct {
	gorm.Model
	Name         string
	NickName     string
	AvatarURL    string
	StravaUserID uint64 `gorm:"unique"`
	AccessToken  EncryptedString
	RefreshToken EncryptedString
	ExpiresAt    time.Time
	CreatedAt    time.Time `gorm:"autoCreateTime:true"`
	UpdatedAt    time.Time `gorm:"autoUpdateTime:true"`
}

type EncryptedString

type EncryptedString string

func (*EncryptedString) Scan

func (es *EncryptedString) Scan(ctx context.Context, field *schema.Field, dst reflect.Value, dbValue interface{}) (err error)

ctx: contains request-scoped values field: the field using the serializer, contains GORM settings, struct tags dst: current model value dbValue: current field's value in database

func (EncryptedString) Value

func (es EncryptedString) Value(ctx context.Context, field *schema.Field, dst reflect.Value, fieldValue interface{}) (interface{}, error)

ctx: contains request-scoped values field: the field using the serializer, contains GORM settings, struct tags dst: current model value fieldValue: current field's value of the dst

type Healthz

type Healthz struct {
	Id        int `gorm:"primary_key"`
	UUID      uuid.UUID
	UpdatedAt time.Time `gorm:"autoUpdateTime:true"`
}

func (Healthz) TableName

func (Healthz) TableName() string

Jump to

Keyboard shortcuts

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