postgres

package
v0.0.0-...-c5189f0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FitbitManagerTransactionKey

type FitbitManagerTransactionKey struct{}

type Logger

type Logger struct {
}

func NewLogger

func NewLogger() *Logger

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, msg string, args ...any)

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, msg string, args ...any)

func (*Logger) LogMode

func (l *Logger) LogMode(level logger.LogLevel) logger.Interface

func (*Logger) Trace

func (l *Logger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)

func (*Logger) Warn

func (l *Logger) Warn(ctx context.Context, msg string, args ...any)

type OAuth2Token

type OAuth2Token struct {
	UserID       string `gorm:"primarykey"`
	AccessToken  string
	RefreshToken string
	Expiry       synchro.Time[tz.AsiaTokyo]
	CreatedAt    synchro.Time[tz.AsiaTokyo]
	UpdatedAt    synchro.Time[tz.AsiaTokyo]
	DeletedAt    gorm.DeletedAt `gorm:"index"`
}

type PostgresClient

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

func NewPostgres

func NewPostgres(ctx context.Context, dsn config.PSQLDSN) (*PostgresClient, error)

func (*PostgresClient) GetOAuth2Token

func (p *PostgresClient) GetOAuth2Token(ctx context.Context, userID string) (domain.OAuth2Token, error)

func (*PostgresClient) SaveOAuth2Token

func (p *PostgresClient) SaveOAuth2Token(ctx context.Context, userID string, token domain.OAuth2Token) error

Jump to

Keyboard shortcuts

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