authorization

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowTypesPlugin

type AllowTypesPlugin struct {
	// contains filtered or unexported fields
}

func NewAllowTypesPlugin

func NewAllowTypesPlugin(args []string) (*AllowTypesPlugin, error)

func (*AllowTypesPlugin) Authorize

type Config

type Config struct {
	// If the plugin should be started by file-butler as another process:
	// Cmd is the command and args to run the plugin.
	// Example: "go run ./plugin/simple"
	Cmd []string
	// If the plugin is started as a standalone process:
	// Addr is the host:port the plugin listens on.
	Addr string
	// BuiltIn is the identifier for a built-in plugin.
	BuiltIn string
	// Args are the arguments to pass to the plugin. (only used with Cmd and BuiltIn)
	Args []string

	// Name is the unique name of the plugin used to identify it.
	Name string

	LogLevel hclog.Level
}

Config defines the configuration required to start a plugin.

There are three types: - Cmd: An external binary or script that should be started using this command. - Addr: The host:port to an already running process that should be connected to. Only grpc is supported. - BuiltIn: If a built-in plugin should be used. These will not ran as a part of the file-butler application.

type Plugin

type Plugin interface {
	Name() string
	Stop() error
	shared.Authorizer
}

func NewPlugin

func NewPlugin(cfg Config) (Plugin, error)

NewPlugin creates a new plugin instance, either by starting a new process or connecting to an existing one. It is up to the caller to call Stop on the plugin when it is no longer needed. Check the documentation for the Config type for more information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL