mongomedia

package
v0.0.0-...-9e0c27b Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2012 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = Configuration{
	GridFSName: "media",
}

Functions

func Init

func Init(name string) error

Init must be called after mongo.Init()

Types

type Backend

type Backend struct {
	GridFS *mgo.GridFS
	Images *mongo.Collection
	// contains filtered or unexported fields
}

func (*Backend) CountImageRefs

func (self *Backend) CountImageRefs(imageID string) (int, error)

func (*Backend) DeleteImage

func (self *Backend) DeleteImage(image *media.Image) error

func (*Backend) DeleteImageVersion

func (self *Backend) DeleteImageVersion(id string) error

func (*Backend) ImageIterator

func (self *Backend) ImageIterator() model.Iterator

func (*Backend) ImageVersionReader

func (self *Backend) ImageVersionReader(id string) (reader io.ReadCloser, ctype string, err error)

func (*Backend) ImageVersionWriter

func (self *Backend) ImageVersionWriter(version *media.ImageVersion) (writer io.WriteCloser, err error)

func (*Backend) LoadImage

func (self *Backend) LoadImage(id string) (*media.Image, error)

func (*Backend) RemoveAllImageRefs

func (self *Backend) RemoveAllImageRefs(imageID string) error

func (*Backend) SaveImage

func (self *Backend) SaveImage(image *media.Image) error

func (*Backend) TryLoadImage

func (self *Backend) TryLoadImage(id string) (*media.Image, bool, error)

type Configuration

type Configuration struct {
	GridFSName string
	Backend    Backend
}

func (*Configuration) Close

func (self *Configuration) Close() error

func (*Configuration) Init

func (self *Configuration) Init() error

func (*Configuration) Name

func (self *Configuration) Name() string

type ImageDoc

type ImageDoc struct {
	mongo.DocumentBase `bson:",inline"`
	media.Image        `bson:",inline"`
}

func (*ImageDoc) GetAndInitImage

func (self *ImageDoc) GetAndInitImage() *media.Image

func (*ImageDoc) Init

func (self *ImageDoc) Init(collection *mongo.Collection, embeddingStruct interface{})

func (*ImageDoc) Save

func (self *ImageDoc) Save() error

Jump to

Keyboard shortcuts

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