services

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func LoadS3Config

func LoadS3Config(s3Data models.ConfigS3) (aws.Config, error)

Types

type AuthService

type AuthService interface {
	ReadUser() (models.User, error)
	CreateUser(payload models.RegisterPayload) error
	UpdateUser(payload models.User) error
	ReadUserWithId(id string) (models.User, error)
	UpdateOTP(user models.User) error
	EnablingOTP(user models.User) error
}

func NewAuthService

func NewAuthService(logger *slog.Logger, filename string) AuthService

type PublicLinkManager

type PublicLinkManager interface {
	CreatePublicLink(payload models.PublicLink) error
	ReadPublicLinks() []models.PublicLink
	UpdatePublicLink(id string, updated models.PublicLink) error
	DeletePublicLink(id string) error
	CheckIfRootPublic(bucket, path string) bool
	CheckSecurity(bucket, path, accessKey string) models.Security
	SearchPublicLinks(query string) []models.PublicLink
	GetRootByLink(link string) (models.PublicLink, error)
	SaveToFile() error
	LoadFromFile() error
	IsLinkDuplicate(link, id string) bool
}

func NewDataPublic

func NewDataPublic(logger *slog.Logger, filename string) PublicLinkManager

type S3Service

type S3Service interface {
	IsS3ConfigEmpty() bool
	InputS3Config(cfg models.ConfigS3) string
	ListPageFiles(ctx context.Context, bucket string, prefix string) ([]string, []string, error)
	ListBucket(ctx context.Context) ([]string, error)
	GetDownloadObject(ctx context.Context, bucket string, prefix string) (string, error)
	DownloadFilesAsZip(ctx context.Context, bucket, prefix string) (io.Reader, string, error)

	CreateFolder(ctx context.Context, bucket, content, folderPath string) error
	DeleteObject(ctx context.Context, bucket, path string) error
	RenameObject(ctx context.Context, bucket, oldPath, newPath string) error
	UploadFile(ctx context.Context, bucket, basePath string, file *multipart.FileHeader) error
	ReadConfig(ctx context.Context) models.ConfigS3
	ListFolder(ctx context.Context, bucket string, prefix string) ([]string, error)
	// contains filtered or unexported methods
}

func NewS3Service

func NewS3Service(downloadExp time.Duration, logger *slog.Logger) (S3Service, error)

Jump to

Keyboard shortcuts

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