repositories

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJWTAuthRepository

func NewJWTAuthRepository(secretKey string) repositories.AuthRepository

func NewPlanRepository

func NewPlanRepository(dbPath string) (repositories.PlanRepository, error)

func NewReservationRepository

func NewReservationRepository(filePath string) (repositories.ReservationRepository, error)

具象型のコンストラクタ.

func NewUserRepository

func NewUserRepository(dbPath string) (repositories.UserRepository, error)

Types

type JWTAuthRepository

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

func (*JWTAuthRepository) GenerateToken

func (r *JWTAuthRepository) GenerateToken(_ context.Context, auth *models.Auth) (*models.Token, error)

GenerateToken はJWTトークンを生成します.

func (*JWTAuthRepository) ValidateToken

func (r *JWTAuthRepository) ValidateToken(_ context.Context, tokenString string) (*models.Auth, error)

ValidateToken はJWTトークンを検証します.

type UserRepository

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

func (*UserRepository) FindAll added in v1.0.0

func (r *UserRepository) FindAll(_ context.Context) ([]*models.User, error)

FindAll は全てのユーザーを取得します.

func (*UserRepository) FindByUserID

func (r *UserRepository) FindByUserID(_ context.Context, userID string) (*models.User, error)

FindByUserID はユーザー名からユーザーを検索します.

func (*UserRepository) Store

func (r *UserRepository) Store(_ context.Context, user *models.User) error

Store はユーザーを保存します.

Jump to

Keyboard shortcuts

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