services

package
v0.0.0-...-3a26186 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Get(ctx context.Context, id string) ([]byte, error)
	GetMany(ctx context.Context, ids []string) ([][]byte, error)
	List(ctx context.Context) ([][]byte, error)
	Save(ctx context.Context, id string, value []byte) error
}

type ImageRepository

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

func NewImageRepository

func NewImageRepository(database Database) *ImageRepository

func (*ImageRepository) Get

func (r *ImageRepository) Get(ctx context.Context, id string) (image *model.Image, err error)

func (*ImageRepository) GetMany

func (r *ImageRepository) GetMany(ctx context.Context, ids []string) (images []*model.Image, err error)

func (*ImageRepository) List

func (r *ImageRepository) List(ctx context.Context) (images []*model.Image, err error)

func (*ImageRepository) Save

func (r *ImageRepository) Save(ctx context.Context, image *model.Image) error

type MultipartParser

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

func NewMultipartParser

func NewMultipartParser(maxMem int64) *MultipartParser

func (*MultipartParser) ParseForm

func (m *MultipartParser) ParseForm(r *http.Request) (result []*model.Image, errs []error)

type Redis

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

func NewRedis

func NewRedis(client *redis.Client, prefix string) *Redis

func (*Redis) Get

func (r *Redis) Get(ctx context.Context, id string) (value []byte, err error)

func (*Redis) GetMany

func (r *Redis) GetMany(ctx context.Context, ids []string) (values [][]byte, err error)

func (*Redis) List

func (r *Redis) List(ctx context.Context) (values [][]byte, err error)

func (*Redis) Save

func (r *Redis) Save(ctx context.Context, id string, value []byte) error

type S3Storage

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

func NewS3Storage

func NewS3Storage(
	endpoint string,
	accessKeyID string,
	secretAccessKey string,
	useSSL bool,
	bucketName string,
) *S3Storage

func (*S3Storage) GetURL

func (s *S3Storage) GetURL(image *model.Image) (*url.URL, error)

func (*S3Storage) WriteFile

func (s *S3Storage) WriteFile(
	ctx context.Context,
	image *model.Image,
) error

type TagRepository

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

func NewTagRepository

func NewTagRepository(database Database) *TagRepository

func (*TagRepository) Get

func (r *TagRepository) Get(ctx context.Context, id string) (tag *model.Tag, err error)

func (*TagRepository) GetMany

func (r *TagRepository) GetMany(ctx context.Context, ids []string) (tags []*model.Tag, err error)

func (*TagRepository) List

func (r *TagRepository) List(ctx context.Context) (tags []*model.Tag, err error)

func (*TagRepository) Save

func (r *TagRepository) Save(ctx context.Context, tag *model.Tag) error

type UserRepository

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

func NewUserRepository

func NewUserRepository(database Database) *UserRepository

func (*UserRepository) Get

func (r *UserRepository) Get(ctx context.Context, id string) (user *model.User, err error)

func (*UserRepository) GetMany

func (r *UserRepository) GetMany(ctx context.Context, ids []string) (users []*model.User, err error)

func (*UserRepository) List

func (r *UserRepository) List(ctx context.Context) (users []*model.User, err error)

func (*UserRepository) Save

func (r *UserRepository) Save(ctx context.Context, user *model.User) error

Jump to

Keyboard shortcuts

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