resolvers

package
v0.0.0-...-ac2c546 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadManifest

func ReadManifest(goPath, moduleName string) (*iface.Manifest, error)

ReadManifest reads a plugin manifest.

Types

type Builder

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

Builder is a plugin builder.

func NewBuilder

func NewBuilder(client *Client, resolvers map[string]Descriptor) (*Builder, error)

NewBuilder ...

func (*Builder) Build

func (b *Builder) Build(name string, config map[string]interface{}, resolverName string) (iface.Constructor, error)

Build ...

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client ...

func NewClient

func NewClient(opts ...Opt) (*Client, error)

NewClient ...

func (*Client) Fetch

func (c *Client) Fetch(ctx context.Context, name, version, archive string) (string, error)

Fetch a plugin archive.

func (*Client) GoPath

func (c *Client) GoPath() string

GoPath get the plugins GoPath.

func (*Client) ReadManifest

func (c *Client) ReadManifest(moduleName string) (*iface.Manifest, error)

ReadManifest reads a plugin manifest.

func (*Client) Unzip

func (c *Client) Unzip(name, version string) error

Unzip extracts an archive

type Descriptor

type Descriptor struct {
	// ModuleName (required)
	ModuleName string `description:"plugin's module name." json:"moduleName,omitempty" toml:"moduleName,omitempty" yaml:"moduleName,omitempty"`

	// Version (required)
	Version string `description:"plugin's version." json:"version,omitempty" toml:"version,omitempty" yaml:"version,omitempty"`
}

Descriptor The static part of a plugin configuration (prod).

type DevPlugin

type DevPlugin struct {
	// GoPath plugin's GOPATH. (required)
	GoPath string `description:"plugin's GOPATH." json:"goPath,omitempty" toml:"goPath,omitempty" yaml:"goPath,omitempty"`

	// ModuleName (required)
	ModuleName string `description:"plugin's module name."  json:"moduleName,omitempty" toml:"moduleName,omitempty" yaml:"moduleName,omitempty"`
}

DevPlugin The static part of a plugin configuration (only for dev).

type Opt

type Opt func(*Opts)

Opt ...

type Opts

type Opts struct {
	// Output ...
	Output string
	// Src ...
	Src string
	// Arc ...
	Arc string
	// GoPath ...
	GoPath string
}

Opts ...

func (*Opts) Configure

func (s *Opts) Configure(opts ...Opt) error

Configure ...

type Resolver

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

Resolver ...

func (*Resolver) NewResolver

func (m *Resolver) NewResolver() (iface.ResolverHandler, error)

NewResolver ...

Jump to

Keyboard shortcuts

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