Documentation ¶
Overview ¶
Package ext contains a suite of extensions that can be applied on the app.
Index ¶
- type CachableResource
- type Cache
- type Config
- type Core
- type Extension
- func CacheRequestsExtension(NumCached int, MaxSizeCached int64) Extension
- func DefaultFaviconExtension(filepath string) Extension
- func DefaultIndexFileExtension(filenames ...string) Extension
- func ListFolderExtension(helper *MinioHelper, listFolder bool, listFolderObjects string) Extension
- func RenderMarkdownExtension(templateFile string) Extension
- type Favicon
- type Handler
- type HandlerDecorator
- type IndexHTML
- type ListFolderExt
- type Markdown
- type MinioHelper
- type Resource
- type ResourceInfo
- type ServeHandler
- type ServeHandlerDecorator
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachableResource ¶
type CachableResource struct { // Data to serialize/unserialize. Data []byte // Metadata for the resource. Info ResourceInfo }
CachableResource is used as an intermediate struct to be serialized and deserialized for caching.
type Cache ¶
type Cache struct { // Resource larger than the specified max size (bytes) will not be cached. MaxSizeCached int64 // Max number of resources to cache in memory at any one time. NumCached int // contains filtered or unexported fields }
Cache is use to initialize a gCache (https://github.com/bluele/gcache) to cache resources from S3 compatible storage.
type Extension ¶
Extension is an alias for core.Extension
func CacheRequestsExtension ¶
CacheRequestsExtension installs the extension to cache all GetObject requests to the S3 compatible backend.
func DefaultFaviconExtension ¶
DefaultFaviconExtension returns a default favicon if backend does not have one.
func DefaultIndexFileExtension ¶
DefaultIndexFileExtension installs the extension where a default index file is queried if not provided in the url (e.g. http://abc instead of http://abc/efg.html).
func ListFolderExtension ¶
func ListFolderExtension(helper *MinioHelper, listFolder bool, listFolderObjects string) Extension
ListFolderExtension installs the extension to list folder objects.
func RenderMarkdownExtension ¶
RenderMarkdownExtension installs the markdown extension if a template is provided.
type Favicon ¶
type Favicon struct {
// contains filtered or unexported fields
}
Favicon provides decorator to return a default favicon.
type HandlerDecorator ¶
type HandlerDecorator = core.HandlerDecorator
HandlerDecorator is an alias for core.HandlerDecorator
func GetIndexFileDecorator ¶
func GetIndexFileDecorator(filenames []string) HandlerDecorator
GetIndexFileDecorator installs the extension where a default index file is queried if not provided in the url (e.g. http://abc instead of http://abc/efg.html).
type IndexHTML ¶
type IndexHTML struct {
// contains filtered or unexported fields
}
IndexHTML provides the decorator to insert a default index file to any requests.
func (IndexHTML) GetIndexHTML ¶
GetIndexHTML decorates a GetObject or StatObject function to insert the default index file if required.
type ListFolderExt ¶
type ListFolderExt struct {
// contains filtered or unexported fields
}
ListFolderExt describes the extension to list objects inside a pseudo-minio folder.
func NewListFolderExt ¶
func NewListFolderExt(helper *MinioHelper, listFolder bool, listFolderObjects string) (*ListFolderExt, error)
NewListFolderExt creates a new ListFolderExt object.
func (*ListFolderExt) ListObjectsAsMarkdown ¶
func (ext *ListFolderExt) ListObjectsAsMarkdown(url string) (Resource, error)
ListObjectsAsMarkdown retrieves (non-recursive) objects with a specified prefix and rendered them as markdown Resource.
type Markdown ¶
type Markdown struct {
// contains filtered or unexported fields
}
Markdown provides the decorator to serve markdowns as HMTL.
func (Markdown) RenderMarkdown ¶
func (m Markdown) RenderMarkdown(Serve ServeHandler) ServeHandler
RenderMarkdown decorates a Serve function to render and return a HTML resource from a markdown resource.
type ResourceInfo ¶
type ResourceInfo = core.ResourceInfo
ResourceInfo is an alias for core.ResourceInfo
type ServeHandler ¶
type ServeHandler = core.ServeHandler
ServeHandler is an alias for core.ServeHandler
type ServeHandlerDecorator ¶
type ServeHandlerDecorator = core.ServeHandlerDecorator
ServeHandlerDecorator is an alias for core.ServeHandlerDecorator
type TemplateData ¶
TemplateData provides the view to the HTML template.