Documentation
¶
Index ¶
- Variables
- func TokenHash(token string) []byte
- type AppSource
- type AppSourceVKRouter
- func (a *AppSourceVKRouter) AuthenticationHandler() vk.HandlerFunc
- func (a *AppSourceVKRouter) CapabilitiesHandler() vk.HandlerFunc
- func (a *AppSourceVKRouter) ConnectionsHandler() vk.HandlerFunc
- func (a *AppSourceVKRouter) FileHandler() vk.HandlerFunc
- func (a *AppSourceVKRouter) FindRunnableHandler() vk.HandlerFunc
- func (a *AppSourceVKRouter) GenerateRouter() (*vk.Router, error)
- func (a *AppSourceVKRouter) HandlersHandler() vk.HandlerFunc
- func (a *AppSourceVKRouter) MetaHandler() vk.HandlerFunc
- func (a *AppSourceVKRouter) RunnablesHandler() vk.HandlerFunc
- func (a *AppSourceVKRouter) SchedulesHandler() vk.HandlerFunc
- type BundleSource
- func (b *BundleSource) Applications() []Meta
- func (b *BundleSource) Authentication(identifier, version string) directive.Authentication
- func (b *BundleSource) Capabilities(identifier, namespace, version string) *rcap.CapabilityConfig
- func (b *BundleSource) Connections(identifier, version string) directive.Connections
- func (b *BundleSource) File(identifier, version, filename string) ([]byte, error)
- func (b *BundleSource) FindRunnable(fqfn, _ string) (*directive.Runnable, error)
- func (b *BundleSource) Handlers(identifier, version string) []directive.Handler
- func (b *BundleSource) Queries(identifier, version string) []directive.DBQuery
- func (b *BundleSource) Runnables(identifier, version string) []directive.Runnable
- func (b *BundleSource) Schedules(identifier, version string) []directive.Schedule
- func (b *BundleSource) Start(opts options.Options) error
- type HTTPSource
- func (h *HTTPSource) Applications() []Meta
- func (h *HTTPSource) Authentication(ident, version string) directive.Authentication
- func (h *HTTPSource) Capabilities(ident, namespace, version string) *rcap.CapabilityConfig
- func (h *HTTPSource) Connections(ident, version string) directive.Connections
- func (h *HTTPSource) File(ident, version, filename string) ([]byte, error)
- func (h *HTTPSource) FindRunnable(FQFN, auth string) (*directive.Runnable, error)
- func (h *HTTPSource) Handlers(ident, version string) []directive.Handler
- func (h *HTTPSource) Queries(ident, version string) []directive.DBQuery
- func (h *HTTPSource) Runnables(ident, version string) []directive.Runnable
- func (h *HTTPSource) Schedules(ident, version string) []directive.Schedule
- func (h *HTTPSource) Start(opts options.Options) error
- type HeadlessBundleSource
- func (h *HeadlessBundleSource) Applications() []Meta
- func (h *HeadlessBundleSource) Authentication(identifier, version string) directive.Authentication
- func (h *HeadlessBundleSource) Capabilities(identifier, namespace, version string) *rcap.CapabilityConfig
- func (h *HeadlessBundleSource) Connections(_, _ string) directive.Connections
- func (h *HeadlessBundleSource) File(identifier, version, filename string) ([]byte, error)
- func (h *HeadlessBundleSource) FindRunnable(fqfn, auth string) (*directive.Runnable, error)
- func (h *HeadlessBundleSource) Handlers(identifier, version string) []directive.Handler
- func (h *HeadlessBundleSource) Queries(identifier, version string) []directive.DBQuery
- func (h *HeadlessBundleSource) Runnables(identifier, version string) []directive.Runnable
- func (h *HeadlessBundleSource) Schedules(_, _ string) []directive.Schedule
- func (h *HeadlessBundleSource) Start(opts options.Options) error
- type Meta
Constants ¶
This section is empty.
Variables ¶
var ( ErrRunnableNotFound = errors.New("failed to find requested Runnable") ErrAuthenticationFailed = errors.New("failed to authenticate") )
Functions ¶
Types ¶
type AppSource ¶
type AppSource interface {
// Start indicates to the AppSource that it should prepare for app startup.
Start(opts options.Options) error
// Runnables returns all of the available Runnables.
Runnables(ident, version string) []directive.Runnable
// FindRunnable attempts to find the given Runnable by its fqfn, and returns ErrRunnableNotFound if it cannot.
FindRunnable(fqfn, authHeader string) (*directive.Runnable, error)
// Handlers returns the handlers for the app.
Handlers(ident, version string) []directive.Handler
// Schedules returns the requested schedules for the app.
Schedules(ident, version string) []directive.Schedule
// Connections returns the connections needed for the app.
Connections(ident, version string) directive.Connections
// Authentication provides any auth headers or metadata for the app.
Authentication(ident, version string) directive.Authentication
// Capabilities provides the application's configured capabilities.
Capabilities(ident, namespace, version string) *rcap.CapabilityConfig
// File is a source of files for the Runnables
// TODO: refactor this into a set of capabilities / profiles.
File(identifier, version, path string) ([]byte, error)
// Queries returns the database queries that should be made available.
Queries(ident, version string) []directive.DBQuery
// Applications returns a slice of Meta, metadata about the apps in that app source.
Applications() []Meta
}
func NewBundleSource ¶
NewBundleSource creates a new BundleSource that looks for a bundle at path.
func NewHTTPSource ¶
NewHTTPSource creates a new HTTPSource that looks for a bundle at [host].
func NewHeadlessBundleSource ¶
NewHeadlessBundleSource creates a new HeadlessBundleSource that looks for a bundle at path.
type AppSourceVKRouter ¶
type AppSourceVKRouter struct {
// contains filtered or unexported fields
}
AppSourceVKRouter is a helper struct to generate a VK router that can serve an HTTP AppSource based on an actual AppSource object.
func NewAppSourceVKRouter ¶
func NewAppSourceVKRouter(appSource AppSource, opts options.Options) *AppSourceVKRouter
NewAppSourceVKRouter creates a new AppSourceVKRouter.
func (*AppSourceVKRouter) AuthenticationHandler ¶ added in v0.3.1
func (a *AppSourceVKRouter) AuthenticationHandler() vk.HandlerFunc
AuthenticationHandler is a handler to fetch Authentication data.
func (*AppSourceVKRouter) CapabilitiesHandler ¶ added in v0.3.1
func (a *AppSourceVKRouter) CapabilitiesHandler() vk.HandlerFunc
CapabilitiesHandler is a handler to fetch Capabilities data.
func (*AppSourceVKRouter) ConnectionsHandler ¶ added in v0.3.1
func (a *AppSourceVKRouter) ConnectionsHandler() vk.HandlerFunc
ConnectionsHandler is a handler to fetch Connection data.
func (*AppSourceVKRouter) FileHandler ¶
func (a *AppSourceVKRouter) FileHandler() vk.HandlerFunc
FileHandler is a handler to fetch Files.
func (*AppSourceVKRouter) FindRunnableHandler ¶
func (a *AppSourceVKRouter) FindRunnableHandler() vk.HandlerFunc
FindRunnableHandler is a handler to find a single Runnable.
func (*AppSourceVKRouter) GenerateRouter ¶
func (a *AppSourceVKRouter) GenerateRouter() (*vk.Router, error)
GenerateRouter generates a VK router that uses an AppSource to serve data.
func (*AppSourceVKRouter) HandlersHandler ¶
func (a *AppSourceVKRouter) HandlersHandler() vk.HandlerFunc
HandlersHandler is a handler to fetch Handlers.
func (*AppSourceVKRouter) MetaHandler ¶
func (a *AppSourceVKRouter) MetaHandler() vk.HandlerFunc
MetaHandler is a handler to fetch Metadata.
func (*AppSourceVKRouter) RunnablesHandler ¶
func (a *AppSourceVKRouter) RunnablesHandler() vk.HandlerFunc
RunnablesHandler is a handler to fetch Runnables.
func (*AppSourceVKRouter) SchedulesHandler ¶
func (a *AppSourceVKRouter) SchedulesHandler() vk.HandlerFunc
SchedulesHandler is a handler to fetch Schedules.
type BundleSource ¶
type BundleSource struct {
// contains filtered or unexported fields
}
BundleSource is an AppSource backed by a bundle file.
func (*BundleSource) Applications ¶ added in v0.4.3
func (b *BundleSource) Applications() []Meta
func (*BundleSource) Authentication ¶ added in v0.3.1
func (b *BundleSource) Authentication(identifier, version string) directive.Authentication
Authentication returns the Authentication for the app.
func (*BundleSource) Capabilities ¶ added in v0.3.1
func (b *BundleSource) Capabilities(identifier, namespace, version string) *rcap.CapabilityConfig
func (*BundleSource) Connections ¶ added in v0.3.1
func (b *BundleSource) Connections(identifier, version string) directive.Connections
Connections returns the Connections for the app.
func (*BundleSource) File ¶
func (b *BundleSource) File(identifier, version, filename string) ([]byte, error)
File returns a requested file.
func (*BundleSource) FindRunnable ¶
func (b *BundleSource) FindRunnable(fqfn, _ string) (*directive.Runnable, error)
FindRunnable searches for and returns the requested runnable otherwise ErrRunnableNotFound.
func (*BundleSource) Handlers ¶
func (b *BundleSource) Handlers(identifier, version string) []directive.Handler
Handlers returns the handlers for the app.
func (*BundleSource) Queries ¶ added in v0.4.0
func (b *BundleSource) Queries(identifier, version string) []directive.DBQuery
Queries returns the Queries available to the app.
func (*BundleSource) Runnables ¶
func (b *BundleSource) Runnables(identifier, version string) []directive.Runnable
Runnables returns the Runnables for the app.
type HTTPSource ¶
type HTTPSource struct {
// contains filtered or unexported fields
}
HTTPSource is an AppSource backed by an HTTP client connected to a remote source.
func (*HTTPSource) Applications ¶ added in v0.4.3
func (h *HTTPSource) Applications() []Meta
func (*HTTPSource) Authentication ¶ added in v0.3.1
func (h *HTTPSource) Authentication(ident, version string) directive.Authentication
Authentication returns the Authentication for the app.
func (*HTTPSource) Capabilities ¶ added in v0.3.1
func (h *HTTPSource) Capabilities(ident, namespace, version string) *rcap.CapabilityConfig
Capabilities returns the Capabilities for the app.
func (*HTTPSource) Connections ¶ added in v0.3.1
func (h *HTTPSource) Connections(ident, version string) directive.Connections
Connections returns the Connections for the app.
func (*HTTPSource) File ¶
func (h *HTTPSource) File(ident, version, filename string) ([]byte, error)
File returns a requested file.
func (*HTTPSource) FindRunnable ¶
func (h *HTTPSource) FindRunnable(FQFN, auth string) (*directive.Runnable, error)
FindRunnable returns a nil error if a Runnable with the provided FQFN can be made available at the next sync, otherwise ErrRunnableNotFound is returned.
func (*HTTPSource) Handlers ¶
func (h *HTTPSource) Handlers(ident, version string) []directive.Handler
Handlers returns the handlers for the app.
func (*HTTPSource) Queries ¶ added in v0.4.0
func (h *HTTPSource) Queries(ident, version string) []directive.DBQuery
Queries returns the Queries for the app.
func (*HTTPSource) Runnables ¶
func (h *HTTPSource) Runnables(ident, version string) []directive.Runnable
Runnables returns the Runnables for the app.
type HeadlessBundleSource ¶
type HeadlessBundleSource struct {
// contains filtered or unexported fields
}
HeadlessBundleSource is an AppSource backed by a bundle file (but headless).
func (*HeadlessBundleSource) Applications ¶ added in v0.4.3
func (h *HeadlessBundleSource) Applications() []Meta
Applications returns the slice of Meta for the app.
func (*HeadlessBundleSource) Authentication ¶ added in v0.3.1
func (h *HeadlessBundleSource) Authentication(identifier, version string) directive.Authentication
Authentication returns the Authentication for the app.
func (*HeadlessBundleSource) Capabilities ¶ added in v0.3.1
func (h *HeadlessBundleSource) Capabilities(identifier, namespace, version string) *rcap.CapabilityConfig
Capabilities returns the Capabilities for the app.
func (*HeadlessBundleSource) Connections ¶ added in v0.3.1
func (h *HeadlessBundleSource) Connections(_, _ string) directive.Connections
Connections returns the Connections for the app.
func (*HeadlessBundleSource) File ¶
func (h *HeadlessBundleSource) File(identifier, version, filename string) ([]byte, error)
File returns a requested file.
func (*HeadlessBundleSource) FindRunnable ¶
func (h *HeadlessBundleSource) FindRunnable(fqfn, auth string) (*directive.Runnable, error)
FindRunnable returns a nil error if a Runnable with the provided FQFN can be made available at the next sync, otherwise ErrRunnableNotFound is returned.
func (*HeadlessBundleSource) Handlers ¶
func (h *HeadlessBundleSource) Handlers(identifier, version string) []directive.Handler
Handlers returns the handlers for the app.
func (*HeadlessBundleSource) Queries ¶ added in v0.4.0
func (h *HeadlessBundleSource) Queries(identifier, version string) []directive.DBQuery
Queries returns the Queries for the app.
func (*HeadlessBundleSource) Runnables ¶
func (h *HeadlessBundleSource) Runnables(identifier, version string) []directive.Runnable
Runnables returns the Runnables for the app.