-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.go
69 lines (60 loc) · 2.5 KB
/
types.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
// Package launchr has application implementation.
package launchr
import (
"io/fs"
"github.com/launchrctl/launchr/internal/launchr"
"github.com/launchrctl/launchr/pkg/action"
)
const (
// PkgPath is a main module path.
PkgPath = launchr.PkgPath
)
// Variables for version provided by ldflags.
var (
name = "launchr"
version = "dev"
builtWith string //nolint:unused
)
// Re-export types aliases for usage by external modules.
type (
// App stores global application state.
App = launchr.App
// AppVersion stores application version.
AppVersion = launchr.AppVersion
// PluginInfo provides information about the plugin and is used as a unique data to indentify a plugin.
PluginInfo = launchr.PluginInfo
// Plugin is a common interface for launchr plugins.
Plugin = launchr.Plugin
// OnAppInitPlugin is an interface to implement a plugin for app initialisation.
OnAppInitPlugin = launchr.OnAppInitPlugin
// ActionDiscoveryPlugin is an interface to implement a plugin to discover actions.
ActionDiscoveryPlugin = action.DiscoveryPlugin
// ActionsAlterPlugin is in interface to implement a plugin to alter registered actions.
ActionsAlterPlugin = action.AlterActionsPlugin
// CobraPlugin is an interface to implement a plugin for cobra.
CobraPlugin = launchr.CobraPlugin
// PluginGeneratedData is a struct containing a result information of plugin generation.
PluginGeneratedData = launchr.PluginGeneratedData
// GeneratePlugin is an interface to generate supporting files before build.
GeneratePlugin = launchr.GeneratePlugin
// PluginManager handles plugins.
PluginManager = launchr.PluginManager
// ServiceInfo provides service info for its initialization.
ServiceInfo = launchr.ServiceInfo
// Service is a common interface for a service to register.
Service = launchr.Service
// Config handles application configuration.
Config = launchr.Config
// ConfigAware provides an interface for structs to support launchr configuration setting.
ConfigAware = launchr.ConfigAware
// ManagedFS is a File System managed by launchr.
ManagedFS = launchr.ManagedFS
)
// Version provides app version info.
func Version() *AppVersion { return launchr.Version() }
// RegisterPlugin add a plugin to global pull.
func RegisterPlugin(p Plugin) { launchr.RegisterPlugin(p) }
// GetFsAbsPath returns absolute path for an FS struct.
func GetFsAbsPath(fs fs.FS) string { return launchr.GetFsAbsPath(fs) }
// EnsurePath creates all directories in the path.
func EnsurePath(parts ...string) error { return launchr.EnsurePath(parts...) }