nbt

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Subscribe

func Subscribe(ctx context.Context, conn *nats.Conn) (cleanup func(context.Context) error, resErr error)

Types

type FinishRequest

type FinishRequest struct {
	// ImportPath is the import path of the package that was built.
	ImportPath string `json:"importPath"`
	// FinishToken is forwarded from [*StartResponse.FinishToken], and cannot be
	// blank.
	FinishToken string `json:"token"`
	// Files is a list of files produced by the compilation task, associated to
	// a user-defined label.
	Files map[Label]string `json:"extra,omitempty"`
	// Error is the error that occurred as a result of this compilation task, if
	// any.
	Error *string `json:"error,omitempty"`
}

FinishRequest informs the job server about the result of a compilation task.

func (FinishRequest) ResponseIs

func (FinishRequest) ResponseIs(*FinishResponse)

func (FinishRequest) Subject

func (FinishRequest) Subject() string

type FinishResponse

type FinishResponse struct {
}

type Label

type Label string

Label is a label identifying an additional object produced by a task. It must be a valid part of a file name.

const (
	LabelArchive Label = "_pkg_.a"
	LabelAsmhdr  Label = "go_asm.h"
)

type StartRequest

type StartRequest struct {
	ImportPath string `json:"importPath"`
	BuildID    string `json:"buildID"`
}

StartRequest informs the job server that the caller is starting a new compilation task for the specified [StartRequest.ImportPath].

func (StartRequest) ResponseIs

func (StartRequest) ResponseIs(*StartResponse)

func (StartRequest) Subject

func (StartRequest) Subject() string

type StartResponse

type StartResponse struct {
	// FinishToken is the token to be forwarded to the [FinishRequest] to inform
	// the job server about the outcome of the build. It cannot be blank unless
	// [*StartResponse.ArchivePath] is not blank.
	FinishToken string `json:"token,omitempty"`
	// Files is the set of files produced by the original task, by label. These
	// files must be re-used instead of re-created. Always blank if
	// [*StartResponse.FinishToken] is not blank.
	Files map[Label]string `json:"extra,omitempty"`
}

StartResponse informs the caller about what should be done with the compilation task. If a [*StartResponse.FinishToken] is present, the caller must proceed with the task, then send a FinishRequest using that token. If a [*StartResponse.ArchivePath] is present, the caller must skip the task and instead re-use the file at the specified path.

Jump to

Keyboard shortcuts

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