package buildflags

import "github.com/docker/buildx/util/buildflags"

Index

Functions

func CanonicalizeAttest

func CanonicalizeAttest(attestType string, in string) string

func ConvertAttests

func ConvertAttests(in []*Attest) ([]*controllerapi.Attest, error)

ConvertAttests converts Attestations for the controller API from the ones in this package.

Attestations of the same type will cause an error. Some tools, like bake, remove the duplicates before calling this function.

func IsGitSSH

func IsGitSSH(repo string) bool

IsGitSSH returns true if the given repo URL is accessed over ssh

func ParseAnnotations

func ParseAnnotations(inp []string) (map[exptypes.AnnotationKey]string, error)

func ParseAttest

func ParseAttest(in string) (*controllerapi.Attest, error)

func ParseAttests

func ParseAttests(in []string) ([]*controllerapi.Attest, error)

func ParseCallFunc

func ParseCallFunc(str string) (*controllerapi.CallFunc, error)

func ParseContextNames

func ParseContextNames(values []string) (map[string]string, error)

func ParseEntitlements

func ParseEntitlements(in []string) ([]string, error)

func ParseExports

func ParseExports(inp []string) ([]*controllerapi.ExportEntry, error)

func ParseSSHSpecs

func ParseSSHSpecs(sl []string) ([]*controllerapi.SSH, error)

func ParseSecretSpecs

func ParseSecretSpecs(sl []string) ([]*controllerapi.Secret, error)

Types

type Attest

type Attest struct {
	Type     string            `json:"type"`
	Disabled bool              `json:"disabled,omitempty"`
	Attrs    map[string]string `json:"attrs,omitempty"`
}

func (*Attest) Equal

func (a *Attest) Equal(other *Attest) bool

func (*Attest) FromCtyValue

func (e *Attest) FromCtyValue(in cty.Value, p cty.Path) error

func (*Attest) MarshalJSON

func (a *Attest) MarshalJSON() ([]byte, error)

func (*Attest) String

func (a *Attest) String() string

func (*Attest) ToCtyValue

func (e *Attest) ToCtyValue() cty.Value

func (*Attest) ToPB

func (a *Attest) ToPB() *controllerapi.Attest

func (*Attest) UnmarshalJSON

func (a *Attest) UnmarshalJSON(data []byte) error

func (*Attest) UnmarshalText

func (a *Attest) UnmarshalText(text []byte) error

type Attests

type Attests []*Attest

func (*Attests) FromCtyValue

func (e *Attests) FromCtyValue(in cty.Value, p cty.Path) error

func (Attests) Merge

func (a Attests) Merge(other Attests) Attests

func (Attests) Normalize

func (a Attests) Normalize() Attests

func (Attests) ToCtyValue

func (e Attests) ToCtyValue() cty.Value

func (Attests) ToPB

func (a Attests) ToPB() []*controllerapi.Attest

type CacheOptions

type CacheOptions []*CacheOptionsEntry

func ParseCacheEntry

func ParseCacheEntry(in []string) (CacheOptions, error)

func (*CacheOptions) FromCtyValue

func (o *CacheOptions) FromCtyValue(in cty.Value, p cty.Path) error

func (CacheOptions) Merge

func (o CacheOptions) Merge(other CacheOptions) CacheOptions

func (CacheOptions) Normalize

func (o CacheOptions) Normalize() CacheOptions

func (CacheOptions) ToCtyValue

func (o CacheOptions) ToCtyValue() cty.Value

func (CacheOptions) ToPB

type CacheOptionsEntry

type CacheOptionsEntry struct {
	Type  string            `json:"type"`
	Attrs map[string]string `json:"attrs,omitempty"`
}

func (*CacheOptionsEntry) Equal

func (e *CacheOptionsEntry) Equal(other *CacheOptionsEntry) bool

func (*CacheOptionsEntry) FromCtyValue

func (o *CacheOptionsEntry) FromCtyValue(in cty.Value, p cty.Path) error

func (*CacheOptionsEntry) MarshalJSON

func (e *CacheOptionsEntry) MarshalJSON() ([]byte, error)

func (*CacheOptionsEntry) String

func (e *CacheOptionsEntry) String() string

func (*CacheOptionsEntry) ToCtyValue

func (o *CacheOptionsEntry) ToCtyValue() cty.Value

func (*CacheOptionsEntry) ToPB

func (*CacheOptionsEntry) UnmarshalJSON

func (e *CacheOptionsEntry) UnmarshalJSON(data []byte) error

func (*CacheOptionsEntry) UnmarshalText

func (e *CacheOptionsEntry) UnmarshalText(text []byte) error

type ExportEntry

type ExportEntry struct {
	Type        string            `json:"type"`
	Attrs       map[string]string `json:"attrs,omitempty"`
	Destination string            `json:"dest,omitempty"`
}

func (*ExportEntry) Equal

func (e *ExportEntry) Equal(other *ExportEntry) bool

func (*ExportEntry) FromCtyValue

func (e *ExportEntry) FromCtyValue(in cty.Value, p cty.Path) error

func (*ExportEntry) MarshalJSON

func (e *ExportEntry) MarshalJSON() ([]byte, error)

func (*ExportEntry) String

func (e *ExportEntry) String() string

func (*ExportEntry) ToCtyValue

func (e *ExportEntry) ToCtyValue() cty.Value

func (*ExportEntry) ToPB

func (*ExportEntry) UnmarshalJSON

func (e *ExportEntry) UnmarshalJSON(data []byte) error

func (*ExportEntry) UnmarshalText

func (e *ExportEntry) UnmarshalText(text []byte) error

type Exports

type Exports []*ExportEntry

func (*Exports) FromCtyValue

func (e *Exports) FromCtyValue(in cty.Value, p cty.Path) error

func (Exports) Merge

func (e Exports) Merge(other Exports) Exports

func (Exports) Normalize

func (e Exports) Normalize() Exports

func (Exports) ToCtyValue

func (e Exports) ToCtyValue() cty.Value

func (Exports) ToPB

func (e Exports) ToPB() []*controllerapi.ExportEntry

type SSH

type SSH struct {
	ID    string   `json:"id,omitempty" cty:"id"`
	Paths []string `json:"paths,omitempty" cty:"paths"`
}

func (*SSH) Equal

func (s *SSH) Equal(other *SSH) bool

func (*SSH) FromCtyValue

func (e *SSH) FromCtyValue(in cty.Value, p cty.Path) error

func (*SSH) Less

func (s *SSH) Less(other *SSH) int

func (*SSH) String

func (s *SSH) String() string

func (*SSH) ToCtyValue

func (e *SSH) ToCtyValue() cty.Value

func (*SSH) ToPB

func (s *SSH) ToPB() *controllerapi.SSH

func (*SSH) UnmarshalJSON

func (s *SSH) UnmarshalJSON(data []byte) error

func (*SSH) UnmarshalText

func (s *SSH) UnmarshalText(text []byte) error

type SSHKeys

type SSHKeys []*SSH

func (*SSHKeys) FromCtyValue

func (s *SSHKeys) FromCtyValue(in cty.Value, p cty.Path) error

func (SSHKeys) Merge

func (s SSHKeys) Merge(other SSHKeys) SSHKeys

func (SSHKeys) Normalize

func (s SSHKeys) Normalize() SSHKeys

func (SSHKeys) ToCtyValue

func (s SSHKeys) ToCtyValue() cty.Value

func (SSHKeys) ToPB

func (s SSHKeys) ToPB() []*controllerapi.SSH

type Secret

type Secret struct {
	ID       string `json:"id,omitempty"`
	FilePath string `json:"src,omitempty"`
	Env      string `json:"env,omitempty"`
}

func (*Secret) Equal

func (s *Secret) Equal(other *Secret) bool

func (*Secret) FromCtyValue

func (e *Secret) FromCtyValue(in cty.Value, p cty.Path) error

func (*Secret) String

func (s *Secret) String() string

func (*Secret) ToCtyValue

func (e *Secret) ToCtyValue() cty.Value

func (*Secret) ToPB

func (s *Secret) ToPB() *controllerapi.Secret

func (*Secret) UnmarshalJSON

func (s *Secret) UnmarshalJSON(data []byte) error

func (*Secret) UnmarshalText

func (s *Secret) UnmarshalText(text []byte) error

type Secrets

type Secrets []*Secret

func (*Secrets) FromCtyValue

func (s *Secrets) FromCtyValue(in cty.Value, p cty.Path) error

func (Secrets) Merge

func (s Secrets) Merge(other Secrets) Secrets

func (Secrets) Normalize

func (s Secrets) Normalize() Secrets

func (Secrets) ToCtyValue

func (s Secrets) ToCtyValue() cty.Value

func (Secrets) ToPB

func (s Secrets) ToPB() []*controllerapi.Secret

type Seq

type Seq[V any] func(yield func(V) bool)

Seq is a temporary definition of iter.Seq until we are able to migrate to using go1.23 as our minimum version. This can be removed when go1.24 is released and usages can be changed to use rangefunc.

Source Files

attests.go attests_cty.go cache.go cache_cty.go callfunc.go context.go entitlements.go export.go export_cty.go secrets.go secrets_cty.go ssh.go ssh_cty.go utils.go

Version
v0.22.0 (latest)
Published
Mar 17, 2025
Platform
js/wasm
Imports
28 packages
Last checked
3 weeks ago

Tools for package owners.