repo

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ModeDir = os.ModeDir

Variables

View Source
var (
	RemoveFile = os.Remove
	WriteFile  = os.WriteFile
	ReadFile   = os.ReadFile
	CreateFile = os.Create
	MkdirAll   = os.MkdirAll
	RemoveAll  = os.RemoveAll
	Copy       = io.Copy
	Lstat      = os.Lstat
	Unmarshal  = json.Unmarshal
	Marshal    = json.Marshal
)

Functions

This section is empty.

Types

type CredentialRepo added in v0.1.22

type CredentialRepo struct {
	Log
	// contains filtered or unexported fields
}

func NewCredentialRepo added in v0.1.22

func NewCredentialRepo(ctx context.Context, cfg CredentialRepoConfig) (*CredentialRepo, error)

func (*CredentialRepo) GetByUsername added in v0.1.23

func (r *CredentialRepo) GetByUsername(_ context.Context, user blinkfile.Username) (out app.Credentials, err error)

func (*CredentialRepo) Remove added in v0.1.22

func (r *CredentialRepo) Remove(_ context.Context, userID blinkfile.UserID) error

func (*CredentialRepo) Set added in v0.1.22

type CredentialRepoConfig added in v0.1.22

type CredentialRepoConfig struct {
	Log
	Dir string
}

type FileRepo

type FileRepo struct {
	Log
	// contains filtered or unexported fields
}

func NewFileRepo

func NewFileRepo(ctx context.Context, cfg FileRepoConfig) (*FileRepo, error)

func (*FileRepo) Delete

func (r *FileRepo) Delete(_ context.Context, owner blinkfile.UserID, deleteFiles []blinkfile.FileID) error

func (*FileRepo) DeleteExpiredBefore

func (r *FileRepo) DeleteExpiredBefore(ctx context.Context, t time.Time) (int, error)

func (*FileRepo) Dir

func (r *FileRepo) Dir() string

func (*FileRepo) Get

func (*FileRepo) ListByUser

func (r *FileRepo) ListByUser(_ context.Context, userID blinkfile.UserID) ([]blinkfile.FileHeader, error)

func (*FileRepo) PutHeader added in v0.1.5

func (r *FileRepo) PutHeader(ctx context.Context, putHeader blinkfile.FileHeader) error

func (*FileRepo) Save

func (r *FileRepo) Save(ctx context.Context, file blinkfile.File) error

type FileRepoConfig

type FileRepoConfig struct {
	Log
	Dir string
}

type Log

type Log interface {
	Errorf(ctx context.Context, format string, v ...any)
}

type SessionConfig

type SessionConfig struct {
	Log
	Dir string
}

type SessionRepo added in v0.1.27

type SessionRepo struct {
	Log
	// contains filtered or unexported fields
}

func NewSessionRepo added in v0.1.27

func NewSessionRepo(ctx context.Context, cfg SessionConfig) (*SessionRepo, error)

func (*SessionRepo) Delete added in v0.1.27

func (r *SessionRepo) Delete(ctx context.Context, token app.Token) error

func (*SessionRepo) DeleteAllUserSessions added in v0.1.27

func (r *SessionRepo) DeleteAllUserSessions(ctx context.Context, userID blinkfile.UserID) (int, error)

func (*SessionRepo) Get added in v0.1.27

func (r *SessionRepo) Get(_ context.Context, token app.Token) (app.Session, bool, error)

func (*SessionRepo) Save added in v0.1.27

func (r *SessionRepo) Save(_ context.Context, session app.Session) error

type UserRepo added in v0.1.15

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

func NewUserRepo added in v0.1.15

func NewUserRepo(ctx context.Context, cfg UserRepoConfig) (*UserRepo, error)

func (*UserRepo) Create added in v0.1.15

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

func (*UserRepo) Delete added in v0.1.17

func (r *UserRepo) Delete(_ context.Context, userID blinkfile.UserID) error

func (*UserRepo) Get added in v0.1.23

func (*UserRepo) ListAll added in v0.1.15

func (r *UserRepo) ListAll(_ context.Context) ([]blinkfile.User, error)

type UserRepoConfig added in v0.1.15

type UserRepoConfig struct {
	Log
	Dir string
}

Jump to

Keyboard shortcuts

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