configuration

package
v0.0.0-...-677f5df Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package configuration is used to configure the gopackagesdriver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WorkspaceConfigDir

func WorkspaceConfigDir(ctx context.Context, params *Params) (string, error)

WorkspaceConfigDir returns the configuration directory in the workspace, if it exists.

func WriteProcessInfoToFile

func WriteProcessInfoToFile(ctx context.Context, params *Params, grpcAddr string) (func() error, error)

WriteProcessInfoToFile writes a .pbtxt (protobuf text) file to a file in the workspace with information about this process.

Types

type Params

type Params struct {
	RulesGoRepositoryName string
	BazelBin              string
	BazelFlags            []string
	BazelQueryFlags       []string
	BazelQueryScope       string
	BazelBuildFlags       []string
	WorkspaceRoot         string
}

Params is a struct to hold the values of parameters used by the driver. These typically come from the

func FromEnv

func FromEnv() *Params

FromEnv returns a *Params object based on os.Env values.

func (*Params) Proto

func (p *Params) Proto() *pb.EnvParams

type ProcessInfoFile

type ProcessInfoFile struct {
	Path     string
	Contents *pb.ProcessInfo
}

func FindProcessInfoFiles

func FindProcessInfoFiles(ctx context.Context, params *Params) ([]*ProcessInfoFile, error)

FindProcessInfoFiles returns all of the process info files in the config directory. This function can be used to connect to an active server.

func (*ProcessInfoFile) ProcessExists

func (f *ProcessInfoFile) ProcessExists() bool

ProcessExists reports if the process referenced by the ProcessInfo file is active.

It does this using the approach in https://stackoverflow.com/questions/15204162/check-if-a-process-exists-in-go-way. As such, this may only work on UNIX-like systems.

Jump to

Keyboard shortcuts

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