Documentation ¶
Overview ¶
Package yagfuncdata provides up-to-date information regarding the set of functions available in YAGPDB templates.
Index ¶
- Variables
- func Fetch(ctx context.Context, sources []Source) (funcs []string, err error)
- type BaseContextFuncSource
- type BuiltinFuncSource
- type FileContentProvider
- type GitHubFileProvider
- type InteractionContextFuncSource
- type PluginExtensionFuncSource
- func NewCommandsPluginExtensionFuncSource(fcp FileContentProvider) *PluginExtensionFuncSource
- func NewCustomCommandsPluginExtensionFuncSource(fcp FileContentProvider) *PluginExtensionFuncSource
- func NewLogsPluginExtensionFuncSource(fcp FileContentProvider) *PluginExtensionFuncSource
- func NewTicketsPluginExtensionFuncSource(fcp FileContentProvider) *PluginExtensionFuncSource
- type Source
- type StaticFileProvider
Constants ¶
This section is empty.
Variables ¶
var DefaultFileContentProvider = NewGitHubFileProvider(github.NewClient(nil), "botlabs-gg", "yagpdb", "master")
DefaultFileContentProvider is a FileContentProvider that accesses files on the master branch of the YAGPDB repository using an unauthenticated GitHub client.
Functions ¶
Types ¶
type BaseContextFuncSource ¶
type BaseContextFuncSource struct {
// contains filtered or unexported fields
}
func NewBaseContextFuncSource ¶
func NewBaseContextFuncSource(fcp FileContentProvider) *BaseContextFuncSource
NewBaseContextFuncSource creates a new Source that provides information regarding functions defined in common/templates/context.go, which include base context and standard functions.
type BuiltinFuncSource ¶
type BuiltinFuncSource struct {
// contains filtered or unexported fields
}
func NewBuiltinFuncSource ¶
func NewBuiltinFuncSource(fcp FileContentProvider) *BuiltinFuncSource
NewBuiltinFuncSource creates a new Source that provides information regarding builtin template functions defined in lib/template/funcs.go.
type FileContentProvider ¶
type FileContentProvider interface {
Get(ctx context.Context, path string) (content string, err error)
}
A FileContentProvider provides access to file content.
type GitHubFileProvider ¶
type GitHubFileProvider struct {
// contains filtered or unexported fields
}
func NewGitHubFileProvider ¶
func NewGitHubFileProvider(client *github.Client, repoOwner, repoName, ref string) *GitHubFileProvider
NewGitHubFileProvider creates a new FileContentProvider that accesses files from a GitHub repository at a specific Git reference using the client provided.
type InteractionContextFuncSource ¶ added in v0.2.1
type InteractionContextFuncSource struct {
// contains filtered or unexported fields
}
func NewInteractionContextFuncSource ¶ added in v0.2.1
func NewInteractionContextFuncSource(fcp FileContentProvider) *InteractionContextFuncSource
NewInteractionContextFuncSource creates a new Source that provides information regarding interaction context functions defined in lib/template/context_interactions.go.
type PluginExtensionFuncSource ¶
type PluginExtensionFuncSource struct {
// contains filtered or unexported fields
}
A PluginExtensionFuncSource provides information regarding template functions added by a plugin. For example, the logs plugin registers pastUsernames and pastNicknames in logs/template_extensions.go.
func NewCommandsPluginExtensionFuncSource ¶
func NewCommandsPluginExtensionFuncSource(fcp FileContentProvider) *PluginExtensionFuncSource
NewCommandsPluginExtensionFuncSource creates a new Source that provides information regarding extension template functions registered by the command plugin in commands/tmplexec.go.
func NewCustomCommandsPluginExtensionFuncSource ¶
func NewCustomCommandsPluginExtensionFuncSource(fcp FileContentProvider) *PluginExtensionFuncSource
NewCustomCommandsPluginExtensionFuncSource creates a new Source that provides information regarding extension template functions registered by the custom commands plugin in customcommands/tmplextensions.go
func NewLogsPluginExtensionFuncSource ¶
func NewLogsPluginExtensionFuncSource(fcp FileContentProvider) *PluginExtensionFuncSource
NewLogsPluginExtensionFuncSource creates a new Source that provides information regarding extension template functions registered by the logs plugin in logs/template_extensions.go.
func NewTicketsPluginExtensionFuncSource ¶
func NewTicketsPluginExtensionFuncSource(fcp FileContentProvider) *PluginExtensionFuncSource
NewTicketsPluginExtensionFuncSource creates a new Source that provides information regarding extension template functions registered by the tickets plugin in tickets/tmplextensions.go.
type Source ¶
A Source is a source of YAGPDB template function information.
func DefaultSources ¶
func DefaultSources(fcp FileContentProvider) []Source
DefaultSources returns a set of builtin sources that use the given FileContentProvider.
type StaticFileProvider ¶
type StaticFileProvider struct {
// contains filtered or unexported fields
}
func NewStaticFileProvider ¶
func NewStaticFileProvider(files map[string]string) *StaticFileProvider
NewStaticFileProvider creates a new FileContentProvider based on the contents of the provided map. For every path such that files[path] == content, Get(ctx, path) will return content.