luciexe

package
v0.0.0-...-a0a3655 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 56 Imported by: 0

Documentation

Overview

Package luciexe implements LUCI Executable protocol, documented in message Executable in https://chromium.googlesource.com/infra/luci/luci-go/+/master/buildbucket/proto/common.proto

Index

Constants

View Source
const BuildStreamName = "build.proto"

BuildStreamName is the name of the build stream, relative to $LOGDOG_STREAM_PREFIX. For more details, see Executable message in https://chromium.googlesource.com/infra/luci/luci-go/+/master/buildbucket/proto/common.proto

Variables

This section is empty.

Functions

func RunnerMain

func RunnerMain(args []string) int

RunnerMain runs LUCI runner, a program that runs a LUCI executable.

Types

type Client

type Client struct {
	// Timestamp for the build message stream.
	// If zero, time.Now is used.
	BuildTimestamp time.Time

	// InitBuild is the initial state of the build read from stdin.
	InitBuild *pb.Build

	// Logdog environment.
	// Logdog.Client can be used to create new LogDog streams.
	Logdog *bootstrap.Bootstrap
	// contains filtered or unexported fields
}

Client can be used by Go programs to implement LUCI Executable protocol.

Example program that does not check errors:

package main

import
  "go.chromium.org/luci/buildbucket/luciexe"
  "go.chromium.org/luci/buildbucket/proto"
)

func main() int {
   var client luciexe.Client
   client.Init()
   client.WriteBuild(&buildbucketpb.Build{
     Steps: []*buildbucketpb.Step{
       {
         Name: "checkout",
         Status: buildbucketpb.SUCCESS,
         // start time, end time
       },
     },
   })
}

TODO(nodir): add support for sub-builds.

func (*Client) Init

func (c *Client) Init() error

Init initializes the client. Populates c.InitBuild and c.ButlerClient.

func (*Client) WriteBuild

func (c *Client) WriteBuild(build *pb.Build) error

WriteBuild sends a new version of Build message to the other side of the protocol, that is the host of the LUCI executable.

Jump to

Keyboard shortcuts

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