Documentation ¶
Overview ¶
Package build defines interfaces for building executable binaries.
Index ¶
- Variables
- type Architecture
- func (m *Architecture) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (m *Architecture) MakeVDLTarget() vdl.Target
- func (x *Architecture) Set(label string) error
- func (x *Architecture) SetFromGoArch(label string) error
- func (x Architecture) String() string
- func (arch Architecture) ToGoArch() string
- func (x Architecture) VDLIsZero() bool
- func (x *Architecture) VDLRead(dec vdl.Decoder) error
- func (x Architecture) VDLWrite(enc vdl.Encoder) error
- type ArchitectureTarget
- type BuilderBuildClientCall
- type BuilderBuildClientStream
- type BuilderBuildServerCall
- type BuilderBuildServerCallStub
- type BuilderBuildServerStream
- type BuilderClientMethods
- type BuilderClientStub
- type BuilderServerMethods
- type BuilderServerStub
- type BuilderServerStubMethods
- type File
- type FileTarget
- func (t *FileTarget) FinishField(_, _ vdl.Target) error
- func (t *FileTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *FileTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *FileTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *FileTarget) ZeroField(name string) error
- type Format
- func (m *Format) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (m *Format) MakeVDLTarget() vdl.Target
- func (x *Format) Set(label string) error
- func (x Format) String() string
- func (x Format) VDLIsZero() bool
- func (x *Format) VDLRead(dec vdl.Decoder) error
- func (x Format) VDLWrite(enc vdl.Encoder) error
- type FormatTarget
- type OperatingSystem
- func (m *OperatingSystem) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (m *OperatingSystem) MakeVDLTarget() vdl.Target
- func (x *OperatingSystem) Set(label string) error
- func (x *OperatingSystem) SetFromGoOS(label string) error
- func (x OperatingSystem) String() string
- func (os OperatingSystem) ToGoOS() string
- func (x OperatingSystem) VDLIsZero() bool
- func (x *OperatingSystem) VDLRead(dec vdl.Decoder) error
- func (x OperatingSystem) VDLWrite(enc vdl.Encoder) error
- type OperatingSystemTarget
Constants ¶
This section is empty.
Variables ¶
var ArchitectureAll = [...]Architecture{ArchitectureAmd64, ArchitectureArm, ArchitectureX86}
ArchitectureAll holds all labels for Architecture.
var BuilderDesc rpc.InterfaceDesc = descBuilder
BuilderDesc describes the Builder interface.
var FormatAll = [...]Format{FormatElf, FormatMach, FormatPe}
FormatAll holds all labels for Format.
var OperatingSystemAll = [...]OperatingSystem{OperatingSystemDarwin, OperatingSystemLinux, OperatingSystemWindows, OperatingSystemAndroid}
OperatingSystemAll holds all labels for OperatingSystem.
Functions ¶
This section is empty.
Types ¶
type Architecture ¶
type Architecture int
Architecture specifies the hardware architecture of a host.
const ( ArchitectureAmd64 Architecture = iota ArchitectureArm ArchitectureX86 )
func ArchitectureFromString ¶
func ArchitectureFromString(label string) (x Architecture, err error)
ArchitectureFromString creates a Architecture from a string label.
func (*Architecture) FillVDLTarget ¶
func (*Architecture) MakeVDLTarget ¶
func (m *Architecture) MakeVDLTarget() vdl.Target
func (*Architecture) SetFromGoArch ¶
func (x *Architecture) SetFromGoArch(label string) error
SetFromGoArch assigns the GOARCH string label to x. In particular, it takes care of mapping "386" to "x86" as the former is not a valid VDL enum value.
func (Architecture) String ¶
func (x Architecture) String() string
String returns the string label of x.
func (Architecture) ToGoArch ¶
func (arch Architecture) ToGoArch() string
ToGoArch returns a GOARCH string label for the given Architecture. In particular, it takes care of mapping "x86" to "386" as the latter is not a valid VDL enum value.
func (Architecture) VDLIsZero ¶
func (x Architecture) VDLIsZero() bool
type ArchitectureTarget ¶
type ArchitectureTarget struct { Value *Architecture vdl.TargetBase }
func (*ArchitectureTarget) FromEnumLabel ¶
func (t *ArchitectureTarget) FromEnumLabel(src string, tt *vdl.Type) error
type BuilderBuildClientCall ¶
type BuilderBuildClientCall interface { BuilderBuildClientStream // Finish performs the equivalent of SendStream().Close, then blocks until // the server is done, and returns the positional return values for the call. // // Finish returns immediately if the call has been canceled; depending on the // timing the output could either be an error signaling cancelation, or the // valid positional return values from the server. // // Calling Finish is mandatory for releasing stream resources, unless the call // has been canceled or any of the other methods return an error. Finish should // be called at most once. Finish() ([]byte, error) }
BuilderBuildClientCall represents the call returned from Builder.Build.
type BuilderBuildClientStream ¶
type BuilderBuildClientStream interface { // RecvStream returns the receiver side of the Builder.Build client stream. RecvStream() interface { // Advance stages an item so that it may be retrieved via Value. Returns // true iff there is an item to retrieve. Advance must be called before // Value is called. May block if an item is not available. Advance() bool // Value returns the item that was staged by Advance. May panic if Advance // returned false or was not called. Never blocks. Value() File // Err returns any error encountered by Advance. Never blocks. Err() error } // SendStream returns the send side of the Builder.Build client stream. SendStream() interface { // Send places the item onto the output stream. Returns errors // encountered while sending, or if Send is called after Close or // the stream has been canceled. Blocks if there is no buffer // space; will unblock when buffer space is available or after // the stream has been canceled. Send(item File) error // Close indicates to the server that no more items will be sent; // server Recv calls will receive io.EOF after all sent items. // This is an optional call - e.g. a client might call Close if it // needs to continue receiving items from the server after it's // done sending. Returns errors encountered while closing, or if // Close is called after the stream has been canceled. Like Send, // blocks if there is no buffer space available. Close() error } }
BuilderBuildClientStream is the client stream for Builder.Build.
type BuilderBuildServerCall ¶
type BuilderBuildServerCall interface { rpc.ServerCall BuilderBuildServerStream }
BuilderBuildServerCall represents the context passed to Builder.Build.
type BuilderBuildServerCallStub ¶
type BuilderBuildServerCallStub struct { rpc.StreamServerCall // contains filtered or unexported fields }
BuilderBuildServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements BuilderBuildServerCall.
func (*BuilderBuildServerCallStub) Init ¶
func (s *BuilderBuildServerCallStub) Init(call rpc.StreamServerCall)
Init initializes BuilderBuildServerCallStub from rpc.StreamServerCall.
func (*BuilderBuildServerCallStub) RecvStream ¶
func (s *BuilderBuildServerCallStub) RecvStream() interface { Advance() bool Value() File Err() error }
RecvStream returns the receiver side of the Builder.Build server stream.
func (*BuilderBuildServerCallStub) SendStream ¶
func (s *BuilderBuildServerCallStub) SendStream() interface { Send(item File) error }
SendStream returns the send side of the Builder.Build server stream.
type BuilderBuildServerStream ¶
type BuilderBuildServerStream interface { // RecvStream returns the receiver side of the Builder.Build server stream. RecvStream() interface { // Advance stages an item so that it may be retrieved via Value. Returns // true iff there is an item to retrieve. Advance must be called before // Value is called. May block if an item is not available. Advance() bool // Value returns the item that was staged by Advance. May panic if Advance // returned false or was not called. Never blocks. Value() File // Err returns any error encountered by Advance. Never blocks. Err() error } // SendStream returns the send side of the Builder.Build server stream. SendStream() interface { // Send places the item onto the output stream. Returns errors encountered // while sending. Blocks if there is no buffer space; will unblock when // buffer space is available. Send(item File) error } }
BuilderBuildServerStream is the server stream for Builder.Build.
type BuilderClientMethods ¶
type BuilderClientMethods interface { // Build streams sources to the build server, which then attempts to // build the sources and streams back the compiled binaries. Build(_ *context.T, arch Architecture, os OperatingSystem, _ ...rpc.CallOpt) (BuilderBuildClientCall, error) // Describe generates a description for a binary identified by // the given Object name. Describe(_ *context.T, name string, _ ...rpc.CallOpt) (binary.Description, error) }
BuilderClientMethods is the client interface containing Builder methods.
Builder describes an interface for building binaries from source.
type BuilderClientStub ¶
type BuilderClientStub interface { BuilderClientMethods rpc.UniversalServiceMethods }
BuilderClientStub adds universal methods to BuilderClientMethods.
func BuilderClient ¶
func BuilderClient(name string) BuilderClientStub
BuilderClient returns a client stub for Builder.
type BuilderServerMethods ¶
type BuilderServerMethods interface { // Build streams sources to the build server, which then attempts to // build the sources and streams back the compiled binaries. Build(_ *context.T, _ BuilderBuildServerCall, arch Architecture, os OperatingSystem) ([]byte, error) // Describe generates a description for a binary identified by // the given Object name. Describe(_ *context.T, _ rpc.ServerCall, name string) (binary.Description, error) }
BuilderServerMethods is the interface a server writer implements for Builder.
Builder describes an interface for building binaries from source.
type BuilderServerStub ¶
type BuilderServerStub interface { BuilderServerStubMethods // Describe the Builder interfaces. Describe__() []rpc.InterfaceDesc }
BuilderServerStub adds universal methods to BuilderServerStubMethods.
func BuilderServer ¶
func BuilderServer(impl BuilderServerMethods) BuilderServerStub
BuilderServer returns a server stub for Builder. It converts an implementation of BuilderServerMethods into an object that may be used by rpc.Server.
type BuilderServerStubMethods ¶
type BuilderServerStubMethods interface { // Build streams sources to the build server, which then attempts to // build the sources and streams back the compiled binaries. Build(_ *context.T, _ *BuilderBuildServerCallStub, arch Architecture, os OperatingSystem) ([]byte, error) // Describe generates a description for a binary identified by // the given Object name. Describe(_ *context.T, _ rpc.ServerCall, name string) (binary.Description, error) }
BuilderServerStubMethods is the server interface containing Builder methods, as expected by rpc.Server. The only difference between this interface and BuilderServerMethods is the streaming methods.
type FileTarget ¶
type FileTarget struct { Value *File vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*FileTarget) FinishField ¶
func (t *FileTarget) FinishField(_, _ vdl.Target) error
func (*FileTarget) FinishFields ¶
func (t *FileTarget) FinishFields(_ vdl.FieldsTarget) error
func (*FileTarget) StartField ¶
func (t *FileTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*FileTarget) StartFields ¶
func (t *FileTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*FileTarget) ZeroField ¶
func (t *FileTarget) ZeroField(name string) error
type Format ¶
type Format int
Format specifies the file format of a host.
func FormatFromString ¶
FormatFromString creates a Format from a string label.
func (*Format) MakeVDLTarget ¶
type FormatTarget ¶
type FormatTarget struct { Value *Format vdl.TargetBase }
func (*FormatTarget) FromEnumLabel ¶
func (t *FormatTarget) FromEnumLabel(src string, tt *vdl.Type) error
type OperatingSystem ¶
type OperatingSystem int
OperatingSystem specifies the operating system of a host.
const ( OperatingSystemDarwin OperatingSystem = iota OperatingSystemLinux OperatingSystemWindows OperatingSystemAndroid )
func OperatingSystemFromString ¶
func OperatingSystemFromString(label string) (x OperatingSystem, err error)
OperatingSystemFromString creates a OperatingSystem from a string label.
func (*OperatingSystem) FillVDLTarget ¶
func (*OperatingSystem) MakeVDLTarget ¶
func (m *OperatingSystem) MakeVDLTarget() vdl.Target
func (*OperatingSystem) Set ¶
func (x *OperatingSystem) Set(label string) error
Set assigns label to x.
func (*OperatingSystem) SetFromGoOS ¶
func (x *OperatingSystem) SetFromGoOS(label string) error
SetFromGoOS assigns the GOOS string label to x.
func (OperatingSystem) String ¶
func (x OperatingSystem) String() string
String returns the string label of x.
func (OperatingSystem) ToGoOS ¶
func (os OperatingSystem) ToGoOS() string
ToGoOS returns a GOOS string label for the given Architecture.
func (OperatingSystem) VDLIsZero ¶
func (x OperatingSystem) VDLIsZero() bool
type OperatingSystemTarget ¶
type OperatingSystemTarget struct { Value *OperatingSystem vdl.TargetBase }
func (*OperatingSystemTarget) FromEnumLabel ¶
func (t *OperatingSystemTarget) FromEnumLabel(src string, tt *vdl.Type) error