-
Notifications
You must be signed in to change notification settings - Fork 1
/
gen_pluginsystem.go
118 lines (115 loc) · 4.66 KB
/
gen_pluginsystem.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// Code generated by ifacemaker. DO NOT EDIT.
package ambient
import (
"time"
)
// PluginSystem provides config functions.
type PluginSystem interface {
// LoaderPlugins returns the loader plugins, these include initial gRPC plugins
// as well.
LoaderPlugins() []Plugin
// LoaderMiddleware returns the loader middleware, these include initial gRPC plugins
// as well.
LoaderMiddleware() []MiddlewarePlugin
// Plugins returns the map of plugins. This returns a map that is passed by
// reference and all the values are pointers so any changes to it will
// be reflected in the plugin system.
Plugins() map[string]Plugin
// SessionManager returns the session manager.
SessionManager() SessionManagerPlugin
// TemplateEngine returns the template engine.
TemplateEngine() TemplateEnginePlugin
// Router returns the router.
Router() RouterPlugin
// StorageManager returns the storage manager.
StorageManager() Storage
// LoadPlugin loads a single plugin into the plugin system and saves the config.
LoadPlugin(plugin Plugin, middleware bool, grpcPlugin bool) (err error)
// Load will load the storage and return an error if one occurs.
Load() error
// Save will save the storage and return an error if one occurs.
Save() error
// InitializePlugin will initialize the plugin in the storage and will return
// an error if one occurs.
InitializePlugin(pluginName string, pluginVersion string) error
// RemovePlugin will delete the plugin from the storage and will return
// an error if one occurs.
RemovePlugin(pluginName string) error
// Names returns a list of plugin names.
Names() []string
// MiddlewareNames returns a list of middleware plugin names.
MiddlewareNames() []string
// IsMiddleware returns if the plugin is middleware.
IsMiddleware(name string) bool
// TrustedPluginNames returns a list of sorted trusted names.
TrustedPluginNames() []string
// Trusted returns if a plugin is trusted.
Trusted(pluginName string) bool
// Routes returns a list of plugin routes.
Routes(pluginName string) []Route
// PluginsData returns the plugin data map.
PluginsData() map[string]PluginData
// Plugin returns a plugin by name.
Plugin(name string) (Plugin, error)
// PluginData returns a plugin data by name.
PluginData(name string) (PluginData, error)
// Enabled returns if the plugin is enabled or not. If it cannot be found, it
// will still return false.
Enabled(name string) bool
// SetEnabled sets a plugin as enabled or not.
SetEnabled(pluginName string, enabled bool) error
// GrantRequests returns a list of grant requests.
GrantRequests(pluginName string, grant Grant) ([]GrantRequest, error)
// Authorized returns whether a plugin is inherited granted for a plugin.
Authorized(pluginName string, grant Grant) bool
// Granted returns whether a plugin is explicitly granted for a plugin.
Granted(pluginName string, grant Grant) bool
// SetGrant sets a plugin grant.
SetGrant(pluginName string, grant Grant) error
// RemoveGrant removes a plugin grant.
RemoveGrant(pluginName string, grant Grant) error
// SetSetting sets a plugin setting.
SetSetting(pluginName string, settingName string, value interface{}) error
// Setting returns a setting value.
Setting(pluginName string, settingName string) (interface{}, error)
// SettingDefault returns a setting default for a setting.
SettingDefault(pluginName string, settingName string) (interface{}, error)
// SetRoute saves a route.
SetRoute(pluginName string, route []Route)
// SetTitle sets the title.
SetTitle(title string) error
// Title returns the title.
Title() string
// SetScheme sets the site scheme.
SetScheme(scheme string) error
// Scheme returns the site scheme.
Scheme() string
// SetURL sets the site URL.
SetURL(URL string) error
// URL returns the URL without the scheme at the beginning.
URL() string
// FullURL returns the URL with the scheme at the beginning.
FullURL() string
// Updated returns the home last updated timestamp.
Updated() time.Time
// Tags returns the list of tags.
Tags(onlyPublished bool) TagList
// SetContent sets the home page content.
SetContent(content string) error
// Content returns the site home page content.
Content() string
// SavePost saves a post.
SavePost(ID string, post Post) error
// PostsAndPages returns the list of posts and pages.
PostsAndPages(onlyPublished bool) PostWithIDList
// PublishedPosts returns the list of published posts.
PublishedPosts() []Post
// PublishedPages returns the list of published pages.
PublishedPages() []Post
// PostBySlug returns the post by slug.
PostBySlug(slug string) PostWithID
// PostByID returns the post by ID.
PostByID(ID string) (Post, error)
// DeletePostByID deletes a post.
DeletePostByID(ID string) error
}