Documentation ¶
Index ¶
- type FileStore
- func (s *FileStore) GetFileReader(name string) (io.ReadCloser, error)
- func (s *FileStore) IsSignatureRequired() bool
- func (s *FileStore) ParseSignature(signed string, name string, expiredAt time.Time) (valid bool, err error)
- func (s *FileStore) PutFileReader(name string, src io.Reader, length int64, contentType string) error
- func (s *FileStore) SignedURL(name string) (string, error)
- type S3Store
- type SignatureParser
- type Store
- type URLSigner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore implements Store by storing files on file system
func NewFileStore ¶
func (*FileStore) GetFileReader ¶
func (s *FileStore) GetFileReader(name string) (io.ReadCloser, error)
func (*FileStore) IsSignatureRequired ¶
func (*FileStore) ParseSignature ¶
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
S3Store implements Store by storing files on S3
func NewS3Store ¶
NewS3Store returns a new S3Store
func (*S3Store) GetFileReader ¶
func (s *S3Store) GetFileReader(name string) (io.ReadCloser, error)
func (*S3Store) IsSignatureRequired ¶
func (*S3Store) PutFileReader ¶
PutFileReader uploads a file to s3 with content from io.Reader
type SignatureParser ¶
type SignatureParser interface {
ParseSignature(signed string, name string, expiredAt time.Time) (valid bool, err error)
}
SignatureParser parses a signed signature string
type Store ¶
type Store interface { GetFileReader(name string) (io.ReadCloser, error) PutFileReader(name string, src io.Reader, length int64, contentType string) error }
Store specify the interfaces of an asset store
type URLSigner ¶
type URLSigner interface { // SignedURL returns a url with access to the named file. If asset // store is private, the returned URL is a signed one, allowing access // to asset for a short period. SignedURL(name string) (string, error) IsSignatureRequired() bool }
URLSigner signs a signature and returns a URL accessible to that asset.
Click to show internal directories.
Click to hide internal directories.