Documentation
¶
Index ¶
- Constants
- Variables
- func AsConfigList(value ard.Value) ard.List
- func AsStringList(value ard.Value) []string
- func Create(config ard.StringMap, context *js.Context) (interface{}, error)
- func DecodeBrotli(bytes_ []byte, writer io.Writer) error
- func DecodeFlate(bytes_ []byte, writer io.Writer) error
- func DecodeGZip(bytes_ []byte, writer io.Writer) error
- func EncodeBrotli(bytes []byte, writer io.Writer) error
- func EncodeFlate(bytes []byte, writer io.Writer) error
- func EncodeGZip(bytes []byte, writer io.Writer) error
- func OnAPIs(f func(name string, api interface{}) bool)
- func OnTags(f func(prefix string, handle HandleTagFunc) bool)
- func OnTypes(f func(type_ string, create CreateFunc) bool)
- func RegisterAPI(name string, api interface{})
- func RegisterRenderer(renderer string, render RenderFunc)
- func RegisterTag(prefix string, handle HandleTagFunc)
- func RegisterType(type_ string, create CreateFunc)
- func Render(content string, renderer string, context *js.Context) (string, error)
- func SetCacheBackend(cacheBackend_ CacheBackend)
- func Start(startables []Startable) error
- func Stop()
- func ToStringList(list ard.List) []string
- type CacheBackend
- type CacheKey
- type CachedRepresentation
- type CreateFunc
- type EncodingType
- type HandleTagFunc
- type JSTContext
- type RenderFunc
- type StartEntry
- type StartGroup
- type Startable
Constants ¶
View Source
const ( EncodingTypeUnsupported = EncodingType(-1) EncodingTypeIdentity = EncodingType(0) EncodingTypeBrotli = EncodingType(1) EncodingTypeGZip = EncodingType(2) EncodingTypeFlate = EncodingType(3) )
Variables ¶
View Source
var NCSAFilename string
Functions ¶
func AsStringList ¶
func OnTags ¶
func OnTags(f func(prefix string, handle HandleTagFunc) bool)
func OnTypes ¶
func OnTypes(f func(type_ string, create CreateFunc) bool)
func RegisterAPI ¶
func RegisterAPI(name string, api interface{})
func RegisterRenderer ¶
func RegisterRenderer(renderer string, render RenderFunc)
func RegisterTag ¶
func RegisterTag(prefix string, handle HandleTagFunc)
func RegisterType ¶
func RegisterType(type_ string, create CreateFunc)
func SetCacheBackend ¶
func SetCacheBackend(cacheBackend_ CacheBackend)
func ToStringList ¶
Types ¶
type CacheBackend ¶
type CacheBackend interface {
LoadRepresentation(key CacheKey) (*CachedRepresentation, bool) // sync
StoreRepresentation(key CacheKey, cached *CachedRepresentation) // async
DeleteRepresentation(key CacheKey) // async
DeleteGroup(name CacheKey) // async
}
func GetCacheBackend ¶
func GetCacheBackend() CacheBackend
type CachedRepresentation ¶
type CachedRepresentation struct {
Groups []CacheKey
Headers map[string][]string
Body map[EncodingType][]byte
Expiration time.Time
}
func (*CachedRepresentation) Expired ¶
func (self *CachedRepresentation) Expired() bool
func (*CachedRepresentation) GetBody ¶
func (self *CachedRepresentation) GetBody(encoding EncodingType) ([]byte, bool)
func (*CachedRepresentation) String ¶
func (self *CachedRepresentation) String() string
fmt.Stringer interface
func (*CachedRepresentation) TimeToLive ¶
func (self *CachedRepresentation) TimeToLive() float64
In seconds
func (*CachedRepresentation) Update ¶
func (self *CachedRepresentation) Update(key CacheKey)
type CreateFunc ¶
func GetType ¶
func GetType(type_ string) (CreateFunc, error)
type EncodingType ¶
type EncodingType int
type HandleTagFunc ¶ added in v1.0.1
type HandleTagFunc func(context *JSTContext, code string) bool // return true to allow trailing newlines
type JSTContext ¶
func (*JSTContext) NextSuffix ¶
func (self *JSTContext) NextSuffix() string
func (*JSTContext) WriteLiteral ¶
func (self *JSTContext) WriteLiteral(literal string)
type RenderFunc ¶
func GetRenderer ¶
func GetRenderer(renderer string) (RenderFunc, error)
type StartEntry ¶
type StartEntry struct {
Startable Startable
}
type StartGroup ¶
type StartGroup struct {
Startables []Startable
// contains filtered or unexported fields
}
func NewStartGroup ¶
func NewStartGroup(startables []Startable) *StartGroup
func (*StartGroup) Start ¶
func (self *StartGroup) Start()
func (*StartGroup) Stop ¶
func (self *StartGroup) Stop()
Click to show internal directories.
Click to hide internal directories.