Documentation ¶
Overview ¶
Package host provides a plugin type used to interface with boundary's host related resources. Additionally it provides a repository for performing CRUDL and custom operations on this plugin type.
Index ¶
- Constants
- func GetOpts(opt ...Option) options
- type Option
- type Plugin
- type Repository
- func (r *Repository) CreatePlugin(ctx context.Context, p *Plugin, opt ...Option) (*Plugin, error)
- func (r *Repository) ListPlugins(ctx context.Context, scopeIds []string, opt ...Option) ([]*Plugin, error)
- func (r *Repository) LookupPlugin(ctx context.Context, id string, _ ...Option) (*Plugin, error)
- func (r *Repository) LookupPluginByName(ctx context.Context, name string, _ ...Option) (*Plugin, error)
Constants ¶
const (
PluginPrefix = "pl"
)
PublicId prefixes for the resources in the plugin package.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*options)
Option - how Options are passed as arguments.
func WithDescription ¶
WithDescription provides an optional description.
func WithLimit ¶
WithLimit provides an option to provide a limit. Intentionally allowing negative integers. If WithLimit < 0, then unlimited results are returned. If WithLimit == 0, then default limits are used for results.
func WithPublicId ¶
WithPublicId provides an optional specific public ID
type Plugin ¶
A Plugin enables additional logic to be used by boundary. It is owned by a scope.
func NewPlugin ¶
NewPlugin creates a new in memory Plugin assigned to the global scope. Name, Description are the only allowed option. All other options are ignored.
func (*Plugin) SetTableName ¶
SetTableName sets the table name. If the caller attempts to set the name to "" the name will be reset to the default name.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
A Repository stores and retrieves the persistent types in the host package. It is not safe to use a repository concurrently.
func NewRepository ¶
NewRepository creates a new Repository. The returned repository should only be used for one transaction and it is not safe for concurrent go routines to access it. WithLimit option is used as a repo wide default limit applied to all ListX methods.
func (*Repository) CreatePlugin ¶
CreatePlugin inserts p into the repository and returns a new Plugin containing the plugin's PublicId. p is not changed. p must contain a valid ScopeID. p must not contain a PublicId. The PublicId is generated and assigned by this method. opt is ignored.
Both p.Name and p.Description are optional. If p.Name is set, it must be unique within p.ScopeID.
Both p.CreateTime and c.UpdateTime are ignored.
func (*Repository) ListPlugins ¶
func (r *Repository) ListPlugins(ctx context.Context, scopeIds []string, opt ...Option) ([]*Plugin, error)
ListPlugins returns a slice of Plugins for the scope IDs. WithLimit is the only option supported.
func (*Repository) LookupPlugin ¶
LookupPlugin returns the Plugin for id. Returns nil, nil if no Plugin is found for id.
func (*Repository) LookupPluginByName ¶
func (r *Repository) LookupPluginByName(ctx context.Context, name string, _ ...Option) (*Plugin, error)
LookupPluginByName returns the Plugin for a given name. Returns nil, nil if no Plugin is found with that plugin name.