media

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type Media

type Media struct {
	mixin.BaseModel

	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