domain

package
v0.0.0-...-f1ade16 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidID = errors.New("invalid id")
)
View Source
var (
	ErrInvalidSlug = errors.New("invalid slug")
)
View Source
var (
	ErrVideoNotFound = errors.New("video not found")
)

Functions

This section is empty.

Types

type ID

type ID string

func GenerateUUID

func GenerateUUID() ID

func NewID

func NewID(id string) (ID, error)

func (ID) String

func (id ID) String() string

type Slug

type Slug string

func NewSlug

func NewSlug(id string) (Slug, error)

func (Slug) String

func (id Slug) String() string

type Source

type Source struct {
	URL    Slug
	Width  int32
	Height int32
}

func (*Source) MarshalJSON

func (s *Source) MarshalJSON() ([]byte, error)

type SourceDTO

type SourceDTO struct {
	URL    string `json:"url"`
	Width  int32  `json:"width"`
	Height int32  `json:"height"`
}

type Video

type Video struct {
	ID       ID
	Original Source
	Parts    []Source
}

func (*Video) MarshalJSON

func (v *Video) MarshalJSON() ([]byte, error)

type VideoDTO

type VideoDTO struct {
	ID       string   `json:"id"`
	Original Source   `json:"original"`
	Parts    []Source `json:"parts"`
}

type VideoRepository

type VideoRepository interface {
	FindByID(ctx context.Context, id ID) (*Video, error)
	Save(ctx context.Context, video *Video) error
}

Jump to

Keyboard shortcuts

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