types

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Local    string = "local"
	Facebook string = "facebook"
)

AuthType values.

View Source
const (
	ImageGif  string = "image/gif"
	ImageJpeg string = "image/jpeg"
	ImagePng  string = "image/png"
)

Content types

View Source
const (
	Small    string = "small"
	Medium   string = "medium"
	Large    string = "large"
	Original string = ""
)

Image sizes

View Source
const (
	ItemResource string = "item"
)

ResourceType values.

Variables

This section is empty.

Functions

func IsImageContentType added in v0.2.0

func IsImageContentType(contentType string) bool

IsImageContentType .

func IsValidSize added in v0.2.0

func IsValidSize(size string) bool

IsValidSize .

func SizeToPixels added in v0.2.0

func SizeToPixels(size string) int

SizeToPixels .

Types

type Auth added in v0.2.0

type Auth struct {
	database.BasicEntity `bson:",inline"`
	UserID               objectid.ObjectID `bson:"_user_id"`
	Type                 string            `bson:"type"`
	AccessToken          string            `bson:"access_token"`
	Expires              time.Time         `bson:"expires"`
}

Auth .

type Collection

type Collection struct {
	database.BasicEntity `bson:",inline"`
	UserID               objectid.ObjectID `bson:"_user_id" json:"-"`
	Name                 string            `bson:"name" json:"name"`
	Slug                 string            `bson:"slug" json:"slug"`
}

Collection .

type File

type File struct {
	database.BasicEntity `bson:",inline"`
	ResourceType         string            `bson:"resource_type"`
	ResourceID           objectid.ObjectID `bson:"_resource_id"`
	Name                 string            `bson:"name"`
	Path                 string            `bson:"path"`
	Size                 int64             `bson:"size"`
	ContentType          string            `bson:"content_type"`
}

File .

func (File) GenerateURI added in v0.2.0

func (f File) GenerateURI(jwtSecret string) (string, error)

GenerateURI returns new URI to access a file four 24 hours.

type Item

type Item struct {
	database.BasicEntity `bson:",inline"`
	CollectionID         objectid.ObjectID `bson:"_collection_id" json:"-"`
	Picture              string            `bson:"-" json:"picture"`
}

Item .

type User added in v0.2.0

type User struct {
	database.BasicEntity `bson:",inline"`
	Name                 string `bson:"name" json:"name"`
	Email                string `bson:"email" json:"email,omitempty"`
	FacebookID           string `bson:"facebook_id" json:"-"`
}

User .

Jump to

Keyboard shortcuts

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