Documentation ¶
Index ¶
- Constants
- Variables
- type App
- func (a *App) CreateUser(ctx context.Context, args CreateUserArgs) error
- func (a *App) DeleteExpiredFiles(ctx context.Context) error
- func (a *App) DeleteFiles(ctx context.Context, owner blinkfile.UserID, deleteFiles []blinkfile.FileID) error
- func (a *App) DeleteUsers(ctx context.Context, userIDs []blinkfile.UserID) error
- func (a *App) DownloadFile(ctx context.Context, userID blinkfile.UserID, fileID blinkfile.FileID, ...) (blinkfile.FileHeader, error)
- func (a *App) IsAuthenticated(ctx context.Context, token Token) (blinkfile.UserID, bool, error)
- func (a *App) ListFiles(ctx context.Context, owner blinkfile.UserID) ([]blinkfile.FileHeader, error)
- func (a *App) ListUsers(ctx context.Context) ([]blinkfile.User, error)
- func (a *App) Login(ctx context.Context, username blinkfile.Username, password string, ...) (Session, error)
- func (a *App) Logout(ctx context.Context, token Token) error
- func (a *App) SubscribeToFileChanges(userID blinkfile.UserID) (<-chan FileEvent, func())
- func (a *App) UploadFile(ctx context.Context, args UploadFileArgs) error
- type Clock
- type Config
- type CreateUserArgs
- type CredentialRepo
- type Credentials
- type DefaultClock
- type Error
- type ErrorType
- type EventType
- type FileEvent
- type FileRepo
- type Log
- type PasswordHasher
- type Session
- type SessionRepo
- type SessionRequestData
- type Token
- type UploadFileArgs
- type UserRepo
Constants ¶
View Source
const AdminUserID = "_admin"
Variables ¶
View Source
var ( ErrDuplicateUsername = fmt.Errorf("username already exists") ErrUsernameTaken = fmt.Errorf("username already taken") ErrCredentialNotFound = fmt.Errorf("credential not found") )
View Source
var ErrFileNotFound = fmt.Errorf("file not found")
View Source
var ErrPasswordTooShort = fmt.Errorf("password must be at least %d characters long", passwordMinLength)
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { Log // contains filtered or unexported fields }
func (*App) CreateUser ¶ added in v0.1.13
func (a *App) CreateUser(ctx context.Context, args CreateUserArgs) error
func (*App) DeleteFiles ¶
func (*App) DeleteUsers ¶ added in v0.1.20
func (*App) DownloadFile ¶
func (*App) IsAuthenticated ¶
func (*App) SubscribeToFileChanges ¶ added in v0.1.8
func (*App) UploadFile ¶
func (a *App) UploadFile(ctx context.Context, args UploadFileArgs) error
type CreateUserArgs ¶ added in v0.1.13
type CredentialRepo ¶ added in v0.1.22
type Credentials ¶
type DefaultClock ¶
type DefaultClock struct{}
func (*DefaultClock) Now ¶
func (c *DefaultClock) Now() time.Time
type FileEvent ¶ added in v0.1.8
type FileEvent struct { blinkfile.FileHeader Change EventType }
type FileRepo ¶
type FileRepo interface { Save(context.Context, blinkfile.File) error ListByUser(context.Context, blinkfile.UserID) ([]blinkfile.FileHeader, error) DeleteExpiredBefore(context.Context, time.Time) (int, error) Get(context.Context, blinkfile.FileID) (blinkfile.FileHeader, error) Delete(context.Context, blinkfile.UserID, []blinkfile.FileID) error PutHeader(context.Context, blinkfile.FileHeader) error }
type PasswordHasher ¶
type SessionRepo ¶
type SessionRequestData ¶
type UploadFileArgs ¶
type UploadFileArgs struct { Filename string Owner blinkfile.UserID Reader io.ReadCloser Size int64 Password string ExpiresIn longduration.LongDuration Expires time.Time DownloadLimit int64 }
Click to show internal directories.
Click to hide internal directories.