build

package
v0.0.0-...-0921c0e Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package build defines interfaces for building executable binaries.

Index

Constants

This section is empty.

Variables

ArchitectureAll holds all labels for Architecture.

View Source
var BuilderDesc rpc.InterfaceDesc = descBuilder

BuilderDesc describes the Builder interface.

View Source
var FormatAll = [...]Format{FormatElf, FormatMach, FormatPe}

FormatAll holds all labels for Format.

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) Set

func (x *Architecture) Set(label string) error

Set assigns label to x.

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

func (*Architecture) VDLRead

func (x *Architecture) VDLRead(dec vdl.Decoder) error

func (Architecture) VDLReflect

func (Architecture) VDLReflect(struct {
	Name string `vdl:"v.io/v23/services/build.Architecture"`
	Enum struct{ Amd64, Arm, X86 string }
})

func (Architecture) VDLWrite

func (x Architecture) VDLWrite(enc vdl.Encoder) 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

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 File

type File struct {
	Name     string
	Contents []byte
}

File records the name and contents of a file.

func (File) VDLIsZero

func (x File) VDLIsZero() bool

func (*File) VDLRead

func (x *File) VDLRead(dec vdl.Decoder) error

func (File) VDLReflect

func (File) VDLReflect(struct {
	Name string `vdl:"v.io/v23/services/build.File"`
})

func (File) VDLWrite

func (x File) VDLWrite(enc vdl.Encoder) error

type Format

type Format int

Format specifies the file format of a host.

const (
	FormatElf Format = iota
	FormatMach
	FormatPe
)

func FormatFromString

func FormatFromString(label string) (x Format, err error)

FormatFromString creates a Format from a string label.

func (*Format) Set

func (x *Format) Set(label string) error

Set assigns label to x.

func (Format) String

func (x Format) String() string

String returns the string label of x.

func (Format) VDLIsZero

func (x Format) VDLIsZero() bool

func (*Format) VDLRead

func (x *Format) VDLRead(dec vdl.Decoder) error

func (Format) VDLReflect

func (Format) VDLReflect(struct {
	Name string `vdl:"v.io/v23/services/build.Format"`
	Enum struct{ Elf, Mach, Pe string }
})

func (Format) VDLWrite

func (x Format) VDLWrite(enc vdl.Encoder) 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) 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

func (*OperatingSystem) VDLRead

func (x *OperatingSystem) VDLRead(dec vdl.Decoder) error

func (OperatingSystem) VDLReflect

func (OperatingSystem) VDLReflect(struct {
	Name string `vdl:"v.io/v23/services/build.OperatingSystem"`
	Enum struct{ Darwin, Linux, Windows, Android string }
})

func (OperatingSystem) VDLWrite

func (x OperatingSystem) VDLWrite(enc vdl.Encoder) error

Jump to

Keyboard shortcuts

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