segment

package
v0.0.0-...-fde1fe5 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GalleryTypeMetadataValue = "Marker"
	GalleryTypeMetadataKey   = "Gallery-Type"
	COMPLETE_TORSO           = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GalleryQuery

type GalleryQuery struct {
	ContinuationToken string `form:"q"`
	Limit             *int64
}

type GalleryResponse

type GalleryResponse struct {
	CompleteSegmentIds []string `json:"completeSegmentIds"`
	ContinuationToken  *string  `json:"continuationToken"`
	IsTruncated        bool     `json:"isTruncated"`
}

type RequestCreateSegment

type RequestCreateSegment struct {
	Parent      string
	Creator     string
	Content     []byte
	ContentType string
	Order       int
}

type S3Service

type S3Service struct {
	S3                s3iface.S3API
	BucketName        string
	GalleryBucketName string
}

func (*S3Service) Create

func (s *S3Service) Create(segment RequestCreateSegment) (Segment, error)

func (*S3Service) Get

func (s *S3Service) Get(id string) (out Segment, err error)

func (*S3Service) GetGallery

func (s *S3Service) GetGallery(query GalleryQuery) (GalleryResponse, error)

func (*S3Service) GetWithData

func (s *S3Service) GetWithData(id string) (out Segment, err error)

type Segment

type Segment struct {
	ID          string `json:"id"`
	Creator     string `json:"creator"`
	Parent      string `json:"parent"`
	ContentType string `json:"contentType"`
	Order       int    `json:"order"`
	Data        []byte
}

type Service

type Service interface {
	Create(RequestCreateSegment) (Segment, error)
	Get(id string) (Segment, error)
	GetWithData(id string) (Segment, error)
	GetGallery(query GalleryQuery) (GalleryResponse, error)
}

Jump to

Keyboard shortcuts

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