builder

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDockerPath

func WithDockerPath(path string) func(c *Config)

WithDockerPath creates docker path

func WithLinuxAmd64

func WithLinuxAmd64(c *Config)

WithLinuxAmd64 create linux amd docker delegation

Types

type Args

type Args string

Args represents cli arguments

func (Args) Elements

func (a Args) Elements() []string

Elements returns args elements

type Client

type Client struct {
	BaseURL string
	// contains filtered or unexported fields
}

Client represetns a client

func NewClient

func NewClient(baseURL string) *Client

NewClient creates a client

func (*Client) Build

func (c *Client) Build(ctx context.Context, buildSpec *build.Build) (*build.Module, error)

Build builds plugin

func (*Client) IsUp

func (c *Client) IsUp() bool

IsUp returns true if client is up

type Config

type Config struct {
	Runtime build.Runtime
	// contains filtered or unexported fields
}

Config represents config

func NewConfig

func NewConfig() *Config

NewConfig creates a config

type Delegation

type Delegation struct {
	build.Runtime
	Name  string
	Image string
	Port  int
}

Delegation represents a delegation

type Delegations

type Delegations []*Delegation

Delegations represents delegation

func (Delegations) Match

func (d Delegations) Match(runtime *build.Runtime) *Delegation

Match matches delegation with supplied runtime

type Dependency added in v0.6.0

type Dependency struct {
	Mod       *modfile.File
	Parent    string
	ParentSet bool
	BaseURL   string
	OriginURL string
}

Snapshot represent a plugin snapshot

type Option

type Option func(c *Config)

Option represents config option

type Service

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

Service represents builder service

func New

func New(cfg *Config, opts ...Option) *Service

New creates a service

func (*Service) Build

func (s *Service) Build(ctx context.Context, buildSpec *build.Build, opts ...build.Option) (*build.Module, error)

Build builds plugin

type Snapshot

type Snapshot struct {
	Created time.Time

	Spec *build.Spec
	build.GoBuild
	ModuleDestPath  string
	ModuleBuildPath string
	ModFile         *modfile.File
	BuildModPath    string
	ModFiles        []*modfile.File
	Mains           []string
	BaseDir         string
	TempDir         string
	GoDir           string

	GoPath       string
	Dependencies []*Dependency
	// contains filtered or unexported fields
}

Snapshot represent a plugin snapshot

func NewSnapshot

func NewSnapshot(name string, buildMode string, spec *build.Spec, goBuild build.GoBuild) *Snapshot

NewSnapshot creates a snapshot

func (*Snapshot) AppendMain

func (s *Snapshot) AppendMain(loc string)

AppendMain append main files

func (*Snapshot) AppendMod

func (s *Snapshot) AppendMod(file *modfile.File)

AppendMod append mod file

func (*Snapshot) BaseDependencyURL added in v0.6.0

func (s *Snapshot) BaseDependencyURL(index int) string

BaseDependencyURL returns baseDependency

func (*Snapshot) BaseModuleURL added in v0.6.0

func (s *Snapshot) BaseModuleURL() string

BaseModuleURL returns base plugin url

func (*Snapshot) Env

func (s *Snapshot) Env() []string

Env returns go env

func (*Snapshot) GoRoot

func (s *Snapshot) GoRoot() string

GoRoot returns go root

func (*Snapshot) HomeURL

func (s *Snapshot) HomeURL() string

HomeURL returns home dir

func (*Snapshot) MatchDependency added in v0.6.0

func (s *Snapshot) MatchDependency(match *modfile.Replace) *Dependency

func (*Snapshot) PluginMainURL

func (s *Snapshot) PluginMainURL() string

Jump to

Keyboard shortcuts

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