media

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type Media

type Media struct {
	mixin.Model

	Type Type   `json:"type"`
	URI  []byte `json:"uri"`

	ParentMediaId string `json:"parentMediaId,omitempty"`

	// Only for filters and searches, don't rely on this after you get it out
	// of the db. Always check m.ParentMediaId != "".
	IsParent bool `json:"isParent"`

	// Only for filters and searches, don't rely on this after you get it out
	// of the db. Usage is based on which ids(below) are set, always call
	// m.DetermineUsage() to get the correct usage.
	Usage Usage `json:"usage"`

	// This is for ads
	AdIntegration
	ProductId string `json:"productId,omitempty"`
}

func New

func New(db *datastore.Datastore) *Media

func (*Media) Defaults

func (a *Media) Defaults()

func (*Media) DetermineUsage

func (m *Media) DetermineUsage() Usage

func (Media) Fork

func (m Media) Fork() *Media

func (Media) GetMediaSearchFieldAndIds

func (m Media) GetMediaSearchFieldAndIds() (string, []string)

func (Media) GetParentMediaId

func (m Media) GetParentMediaId() string

func (*Media) Init

func (a *Media) Init(db *datastore.Datastore)

func (Media) Kind

func (a Media) Kind() string

func (*Media) Load

func (m *Media) Load(ps []datastore.Property) (err error)

func (*Media) Save

func (m *Media) Save() (ps []datastore.Property, err error)

type Type

type Type string
const (
	ImageType Type = "image"
	VideoType Type = "video"
)

type Usage

type Usage string
const (
	AdUsage      Usage = "ad"
	ProductUsage Usage = "product"
	UnknownUsage Usage = "unknown"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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