Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteFile(ctx context.Context, filename string) error
- func FormatName(in string) string
- func FullRezURL(key string) string
- func GetFileCRC(content []byte) uint32
- func GetGoogleCRC(ctx context.Context, filename string) (uint32, error)
- func ThumbURL(key string) string
- func UploadFile(ctx context.Context, filename string, content []byte) error
- type File
Constants ¶
View Source
const (
Bucket = "iccowalls"
)
Variables ¶
View Source
var (
NameRegex = regexp.MustCompile("[^a-z0-9]")
)
Functions ¶
func FormatName ¶
FormatName formats a filename to match our requirements.
func FullRezURL ¶
FullRezURL returns the URL a cropped version hosted by imgix.
func GetFileCRC ¶
Types ¶
type File ¶
type File struct { CRC32C uint32 `json:"-"` Etag string `json:"etag"` FileURL string `json:"-"` FullRezURL string `json:"cdn"` Name string `json:"key"` Size int64 `json:"-"` ThumbnailURL string `json:"thumbnail"` Created time.Time `json:"created_at"` Updated time.Time `json:"updated_at"` }
File is a subset of storage.ObjectAttrs that we need.
Click to show internal directories.
Click to hide internal directories.