plugins

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallPlugin

func InstallPlugin(repoOwner, repoName, tokenName string) error

InstallPlugin attempts to install an ephemeral-iam plugin from a given Github repo.

func NewHCLogAdapter

func NewHCLogAdapter(l *logrus.Logger, name string) hclog.Logger

NewHCLogAdapter takes an instance of a Logrus logger and returns an hclog logger in the form of an HCLogAdapter.

Types

type EIAMPlugin

type EIAMPlugin interface {
	GetInfo() (name, desc, version string, err error)
	Run() error
}

EIAMPlugin is the interface that is exposed to external plugins to implement.

type EphemeralIamPlugin

type EphemeralIamPlugin struct {
	Name        string
	Description string
	Version     string
	Client      *hcplugin.Client
	Path        string
}

EphemeralIamPlugin holds the metadata of an installed plugin.

type GRPCClient

type GRPCClient struct {
	Client pb.EIAMPluginClient
}

func (*GRPCClient) GetInfo

func (m *GRPCClient) GetInfo() (name, desc, version string, err error)

GetInfo is the gRPC method that is called to get metadata about a plugin.

func (*GRPCClient) Run

func (m *GRPCClient) Run() error

Run is the gRPC method that is called to invoke a plugin's root command.

type GRPCServer

type GRPCServer struct {
	pb.UnimplementedEIAMPluginServer
	Impl EIAMPlugin
}

GRPCServer is the implementation of the go-plugin gRPC server.

func (*GRPCServer) GetInfo

func (m *GRPCServer) GetInfo(ctx context.Context, req *pb.Empty) (*pb.PluginInfo, error)

GetInfo is the gRPC method that is called to get metadata about a plugin.

func (*GRPCServer) Run

func (m *GRPCServer) Run(ctx context.Context, args *pb.Empty) (*pb.Empty, error)

Run is the gRPC method that is called to invoke a plugin's root command.

type HCLogAdapter

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

HCLogAdapter implements the hclog interface. Plugins use hclog to send log entries back to ephemeral-iam and this adapter allows for those logs to be handled by ephemeral-iam's Logrus logger.

func (HCLogAdapter) Debug

func (h HCLogAdapter) Debug(msg string, args ...interface{})

func (HCLogAdapter) Error

func (h HCLogAdapter) Error(msg string, args ...interface{})

func (HCLogAdapter) ImpliedArgs

func (h HCLogAdapter) ImpliedArgs() []interface{}

func (HCLogAdapter) Info

func (h HCLogAdapter) Info(msg string, args ...interface{})

func (HCLogAdapter) IsDebug

func (h HCLogAdapter) IsDebug() bool

func (HCLogAdapter) IsError

func (h HCLogAdapter) IsError() bool

func (HCLogAdapter) IsInfo

func (h HCLogAdapter) IsInfo() bool

func (HCLogAdapter) IsTrace

func (h HCLogAdapter) IsTrace() bool

func (HCLogAdapter) IsWarn

func (h HCLogAdapter) IsWarn() bool

func (HCLogAdapter) Log

func (h HCLogAdapter) Log(level hclog.Level, msg string, args ...interface{})

func (HCLogAdapter) Name

func (h HCLogAdapter) Name() string

func (HCLogAdapter) Named

func (h HCLogAdapter) Named(name string) hclog.Logger

func (HCLogAdapter) ResetNamed

func (h HCLogAdapter) ResetNamed(name string) hclog.Logger

func (*HCLogAdapter) SetLevel

func (h *HCLogAdapter) SetLevel(level hclog.Level)

func (HCLogAdapter) StandardLogger

func (h HCLogAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger

func (HCLogAdapter) StandardWriter

func (h HCLogAdapter) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer

func (HCLogAdapter) Trace

func (h HCLogAdapter) Trace(msg string, args ...interface{})

func (HCLogAdapter) Warn

func (h HCLogAdapter) Warn(msg string, args ...interface{})

func (HCLogAdapter) With

func (h HCLogAdapter) With(args ...interface{}) hclog.Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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