adapter

package
v0.0.0-...-907d554 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContentRepository

func NewContentRepository(bucket string) (usecase.ContentRepository, error)

func NewLockRepository

func NewLockRepository(db *bolt.DB) usecase.LockRepository

NewLockRepository is ...

func NewMetaDataRepository

func NewMetaDataRepository(db *bolt.DB) usecase.MetaDataRepository

NewMetaDataRepository is ...

func NewMockedContentRepository

func NewMockedContentRepository(bucket string) (*contentRepository, error)

func NewUserRepository

func NewUserRepository(db *bolt.DB) usecase.UserRepository

NewUserRepository is ...

Types

type BatchController

type BatchController interface {
	Batch(ctx Context)
}

BatchController is ...

func NewBatchController

func NewBatchController(s usecase.BatchService) BatchController

NewBatchController is ...

type BatchRequest

type BatchRequest struct {
	Operation string           `json:"operation"`
	Transfers []string         `json:"transfers,omitempty"`
	Ref       Ref              `json:"ref,omitempty"`
	Objects   []*ObjectRequest `json:"objects"`
}

BatchRequest is ...

type BatchResponse

type BatchResponse struct {
	Transfer string            `json:"transfer,omitempty"`
	Objects  []*ResponseObject `json:"objects"`
}

BatchResponse is ...

type Context

type Context interface {
	GetHeader(string) string
	GetParam(string) string
	GetRawData() ([]byte, error)
	SetStatus(int)
	SetHeader(string, string)

	GetResponseWriter() io.Writer
	GetRequestReader() io.Reader
}

Context is ...

type Link struct {
	Href      string            `json:"href"`
	Header    map[string]string `json:"header,omitempty"`
	ExpiresAt time.Time         `json:"expires_at,omitempty"`
}

Link is ...

type Lock

type Lock struct {
	ID       string    `json:"id"`
	Path     string    `json:"path"`
	Owner    User      `json:"owner"`
	LockedAt time.Time `json:"locked_at"`
}

type LockController

type LockController interface {
	Lock(ctx Context)
	Unlock(ctx Context)
	List(ctx Context)
	Verify(ctx Context)
}

LockController is ...

func NewLockController

func NewLockController(s usecase.LockService) LockController

type LockListResponse

type LockListResponse struct {
	Locks      []Lock `json:"locks"`
	NextCursor string `json:"next_cursor,omitempty"`
	Message    string `json:"message,omitempty"`
}

type LockRequest

type LockRequest struct {
	Path string `json:"path"`
}

type LockResponse

type LockResponse struct {
	Lock    *Lock  `json:"lock"`
	Message string `json:"message,omitempty"`
}

type LockVerifyRequest

type LockVerifyRequest struct {
	Cursor string `json:"cursor,omitempty"`
	Limit  int    `json:"limit,omitempty"`
}

type LockVerifyResponse

type LockVerifyResponse struct {
	Ours       []Lock `json:"ours"`
	Theirs     []Lock `json:"theirs"`
	NextCursor string `json:"next_cursor,omitempty"`
	Message    string `json:"message,omitempty"`
}

type LocksByCreatedAt

type LocksByCreatedAt []entity.Lock

LocksByCreatedAt is ...

func (LocksByCreatedAt) Len

func (c LocksByCreatedAt) Len() int

func (LocksByCreatedAt) Less

func (c LocksByCreatedAt) Less(i, j int) bool

func (LocksByCreatedAt) Swap

func (c LocksByCreatedAt) Swap(i, j int)

type MockedDownloader

type MockedDownloader struct {
	s3manageriface.DownloaderAPI
	// contains filtered or unexported fields
}

func (MockedDownloader) Download

func (md MockedDownloader) Download(w io.WriterAt, input *s3.GetObjectInput, options ...func(*s3manager.Downloader)) (n int64, err error)

type MockedS3

type MockedS3 struct {
	s3iface.S3API
	// contains filtered or unexported fields
}

func (MockedS3) GetObject

func (ms MockedS3) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error)

func (MockedS3) HeadObject

func (ms MockedS3) HeadObject(input *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)

type MockedS3Data

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

func NewMockedS3Data

func NewMockedS3Data() *MockedS3Data

func (*MockedS3Data) Bytes

func (d *MockedS3Data) Bytes() []byte

func (*MockedS3Data) Close

func (d *MockedS3Data) Close() error

func (*MockedS3Data) Len

func (d *MockedS3Data) Len() int64

func (*MockedS3Data) Read

func (d *MockedS3Data) Read(p []byte) (int, error)

func (*MockedS3Data) Write

func (d *MockedS3Data) Write(p []byte) (int, error)

type MockedUploader

type MockedUploader struct {
	s3manageriface.UploaderAPI
	// contains filtered or unexported fields
}

func (MockedUploader) Upload

func (mu MockedUploader) Upload(input *s3manager.UploadInput, options ...func(*s3manager.Uploader)) (*s3manager.UploadOutput, error)

type ObjectError

type ObjectError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

ObjectError is ...

type ObjectRequest

type ObjectRequest struct {
	Oid      string `json:"oid"`
	Size     int64  `json:"size"`
	User     string `json:"user"`
	Password string `json:"password"`
	Repo     string `json:"repo"`
}

ObjectRequest is ...

type Ref

type Ref struct {
	Name string `json:"name"`
}

Ref is ...

type ResponseObject

type ResponseObject struct {
	Oid     string           `json:"oid"`
	Size    int64            `json:"size"`
	Actions map[string]*Link `json:"actions"`
	Error   *ObjectError     `json:"error,omitempty"`
}

ResponseObject is ...

type TestData

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

type TransferController

type TransferController interface {
	Download(ctx Context)
	Upload(ctx Context)
}

TransferController is ...

func NewTransferController

func NewTransferController(s usecase.TransferService) TransferController

NewTransferController is ...

type UnlockRequest

type UnlockRequest struct {
	Force bool `json:"force"`
}

type UnlockResponse

type UnlockResponse struct {
	Lock    *Lock  `json:"lock"`
	Message string `json:"message,omitempty"`
}

type User

type User struct {
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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