common/

directory
v0.0.0-...-bb1c9d9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0

README

luci-go: LUCI in Go: shared code

GoDoc

Strive to keep this directory and subdirectories from having more than 7-10 libraries. If they grow too large, consider grouping them into informative subcategories.

The following sub-directories exist:

  • data - data organization, manipulation, storage
  • sync - concurrency coordination
  • runtime - libraries relating to debugging/enhancing the go runtime
  • system - libraries for interacting with the operating system

Directories

Path Synopsis
api
buildbucket/buildbucket/v1
Package buildbucket provides access to the Build Bucket Service.
Package buildbucket provides access to the Build Bucket Service.
buildbucket/swarmbucket/v1
Package swarmbucket provides access to the Buildbucket-Swarming integration.
Package swarmbucket provides access to the Buildbucket-Swarming integration.
gitiles
Package gitiles implements GitilesClient in "go.chromium.org/common/proto/gitiles" package on top of Gitiles's REST API.
Package gitiles implements GitilesClient in "go.chromium.org/common/proto/gitiles" package on top of Gitiles's REST API.
internal/gensupport
Package gensupport is an internal implementation detail used by code generated by the google-api-go-generator tool.
Package gensupport is an internal implementation detail used by code generated by the google-api-go-generator tool.
swarming/swarming/v1
Package swarming provides access to the .
Package swarming provides access to the .
bq
Package bq is a library for working with BigQuery.
Package bq is a library for working with BigQuery.
pb
Package pb contains helper protobuf messages used to define BQ schemas.
Package pb contains helper protobuf messages used to define BQ schemas.
Package cli is a helper package for "github.com/maruel/subcommands".
Package cli is a helper package for "github.com/maruel/subcommands".
Package clock is an interface to system time and timers which is easy to test.
Package clock is an interface to system time and timers which is easy to test.
testclock
Package testclock implements clocks for use in tests.
Package testclock implements clocks for use in tests.
Package data holds data manipulation functions.
Package data holds data manipulation functions.
aip160
Package aip160 contains utilities used to comply with API Improvement Proposals (AIPs) from https://google.aip.dev/160.
Package aip160 contains utilities used to comply with API Improvement Proposals (AIPs) from https://google.aip.dev/160.
caching/cache
Package cache implements both in-memory and on-disk caching.
Package cache implements both in-memory and on-disk caching.
caching/cacheContext
Package cacheContext implements a context.Context wrapper which caches the results of Value calls, speeding up subsequent calls for the same key.
Package cacheContext implements a context.Context wrapper which caches the results of Value calls, speeding up subsequent calls for the same key.
caching/lazyslot
Package lazyslot implements a caching scheme for globally shared objects that take significant time to refresh.
Package lazyslot implements a caching scheme for globally shared objects that take significant time to refresh.
caching/lru
Package lru provides least-recently-used (LRU) cache.
Package lru provides least-recently-used (LRU) cache.
cmpbin
Package cmpbin provides binary serialization routines which ensure that the serialized objects maintain the same sort order of the original inputs when sorted bytewise (i.e.
Package cmpbin provides binary serialization routines which ensure that the serialized objects maintain the same sort order of the original inputs when sorted bytewise (i.e.
disjointset
Package DisjointSet provides a disjoint-set data structure with fixed size.
Package DisjointSet provides a disjoint-set data structure with fixed size.
lex64
Package lex64 is a base64 variant that preserves lexicographic ordering of bytestrings.
Package lex64 is a base64 variant that preserves lexicographic ordering of bytestrings.
packedintset
Package packedintset implements a way to store integer sets in compact form.
Package packedintset implements a way to store integer sets in compact form.
rand/cryptorand
Package cryptorand implements a mockable source or crypto strong randomness.
Package cryptorand implements a mockable source or crypto strong randomness.
rand/mathrand
Package mathrand implements a mockable interface for math/rand.Rand.
Package mathrand implements a mockable interface for math/rand.Rand.
recordio
Package recordio implements a basic RecordIO reader and writer.
Package recordio implements a basic RecordIO reader and writer.
sortby
Package sortby provides a succinct way to generate correctly-behaved Less functions for use with the stdlib 'sort' package.
Package sortby provides a succinct way to generate correctly-behaved Less functions for use with the stdlib 'sort' package.
stringset
Package stringset is an exceedingly simple 'set' implementation for strings.
Package stringset is an exceedingly simple 'set' implementation for strings.
strpair
Package strpair implements parsing and formatting of lists of colon-delimited key-value pair strings.
Package strpair implements parsing and formatting of lists of colon-delimited key-value pair strings.
text/intsetexpr
Package intsetexpr implements parsing of expressions like `a{01..03}b`.
Package intsetexpr implements parsing of expressions like `a{01..03}b`.
text/pattern
Package pattern implements lightweight parsable string patterns.
Package pattern implements lightweight parsable string patterns.
text/sanitizehtml
Package sanitizehtml implements a sanitizer of a very limited HTML.
Package sanitizehtml implements a sanitizer of a very limited HTML.
text/sequence
Package sequence implements matching for sequences of strings.
Package sequence implements matching for sequences of strings.
text/stringtemplate
Package stringtemplate implements Python string.Template-like substitution.
Package stringtemplate implements Python string.Template-like substitution.
text/templateproto
Package templateproto defines a proto-based way to configure templates for JSON documents.
Package templateproto defines a proto-based way to configure templates for JSON documents.
text/units
Package units provides common useful printable units.
Package units provides common useful printable units.
treapstore
Package treapstore is a lightweight append-only in-memory key-value store built on top a treap (tree + heap) implementation.
Package treapstore is a lightweight append-only in-memory key-value store built on top a treap (tree + heap) implementation.
Package errors is an augmented replacement package for the stdlib "errors" package.
Package errors is an augmented replacement package for the stdlib "errors" package.
Package exec is intended to be a drop-in replacement for "os/exec" which can be mocked.
Package exec is intended to be a drop-in replacement for "os/exec" which can be mocked.
execmock
Package execmock allows mocking exec commands using the go.chromium.org/luci/common/exec ("luci exec") library, which is nearly a drop-in replacement for the "os/exec" stdlib library.
Package execmock allows mocking exec commands using the go.chromium.org/luci/common/exec ("luci exec") library, which is nearly a drop-in replacement for the "os/exec" stdlib library.
internal/execmockctx
Package execmockctx provides the minimum interface that the `go.chromium.org/luci/common/exec` library needs to hook into the mocking system provided by `go.chromium.org/luci/common/exec/execmock` without needing to actually link the execmock code (including it's registration of the Simple runner, and the implementation of the http test server) into non-test binaries.
Package execmockctx provides the minimum interface that the `go.chromium.org/luci/common/exec` library needs to hook into the mocking system provided by `go.chromium.org/luci/common/exec/execmock` without needing to actually link the execmock code (including it's registration of the Simple runner, and the implementation of the http test server) into non-test binaries.
internal/execmockserver
Package execmockserver implements the "net/rpc" based client/server pair which is used by execmock to communicate to/from mock subprocesses.
Package execmockserver implements the "net/rpc" based client/server pair which is used by execmock to communicate to/from mock subprocesses.
Package flag provides the utilities for implementing command line flags.
Package flag provides the utilities for implementing command line flags.
flagenum
Package flagenum is a utility package which facilitates implementation of flag.Value, json.Marshaler, and json.Unmarshaler interfaces via a string-to- value mapping.
Package flagenum is a utility package which facilitates implementation of flag.Value, json.Marshaler, and json.Unmarshaler interfaces via a string-to- value mapping.
multiflag
Package multiflag is a package providing a flag.Value implementation capable of switching between multiple registered sub-flags, each of which have their own set of parameter flags.
Package multiflag is a package providing a flag.Value implementation capable of switching between multiple registered sub-flags, each of which have their own set of parameter flags.
stringlistflag
Package stringlistflag provides a flag.Value implementation which resolves multiple args into a []string.
Package stringlistflag provides a flag.Value implementation which resolves multiple args into a []string.
stringmapflag
Package stringmapflag provides a flag.Value that, when parsed, augments a map[string]string with the supplied parameter.
Package stringmapflag provides a flag.Value that, when parsed, augments a map[string]string with the supplied parameter.
stringsetflag
Package stringsetflag provides a flag.Value implementation which resolves multiple args into a stringset.
Package stringsetflag provides a flag.Value implementation which resolves multiple args into a stringset.
gae
Package gae defines information about the AppEngine environment.
Package gae defines information about the AppEngine environment.
googleoauth
Package googleoauth contains some helpers related to Google OAuth2.
Package googleoauth contains some helpers related to Google OAuth2.
gs
Package gs implements a versatile Google Storage client on top of the standard Google Storage Go API.
Package gs implements a versatile Google Storage client on top of the standard Google Storage Go API.
iam
Package iam implements wrappers around some Google Cloud IAM APIs.
Package iam implements wrappers around some Google Cloud IAM APIs.
git
footer
Package footer implements parsing logic for git footer and its predecessor (legacy `<KEY>=<arbitrary value>` style).
Package footer implements parsing logic for git footer and its predecessor (legacy `<KEY>=<arbitrary value>` style).
Package iotools contains a collection of I/O-related utility structs and methods.
Package iotools contains a collection of I/O-related utility structs and methods.
Package lhttp implements HTTP client helper code (JSON, automatic retries, authentication, etc).
Package lhttp implements HTTP client helper code (JSON, automatic retries, authentication, etc).
Package logging defines Logger interface and context.Context helpers to put\get logger from context.Context.
Package logging defines Logger interface and context.Context helpers to put\get logger from context.Context.
gologger
Package gologger is a compatibility layer between go-logging library and luci-go/common/logging.
Package gologger is a compatibility layer between go-logging library and luci-go/common/logging.
sdlogger
Package sdlogger is a logger that formats entries as JSON understood by Stackdriver log collectors.
Package sdlogger is a logger that formats entries as JSON understood by Stackdriver log collectors.
net
iputil
Package iputil is a collection of utilities for manipulating IP addresses that has been extracted from UFS because it is not UFS-specific.
Package iputil is a collection of utilities for manipulating IP addresses that has been extracted from UFS because it is not UFS-specific.
Package pagination contains a set of utilities that help performing common tasks associated with pagination.
Package pagination contains a set of utilities that help performing common tasks associated with pagination.
dscursor
Package dscursor contains a set of utilities that help performing common tasks associated with datastore.Cursor.
Package dscursor contains a set of utilities that help performing common tasks associated with datastore.Cursor.
Package proto contains protobuf-related utilities.
Package proto contains protobuf-related utilities.
config
Package config contains luci-config protobuf definitions.
Package config contains luci-config protobuf definitions.
examples
Package examples shows how to design protos which adhere to the Google Cloud API design guide.
Package examples shows how to design protos which adhere to the Google Cloud API design guide.
findings
Package findings contains proto definitions for code findings.
Package findings contains proto definitions for code findings.
gerrit
Package gerritpb contains Gerrit service definition.
Package gerritpb contains Gerrit service definition.
git
Package git contains Git-related protobuf definitions.
Package git contains Git-related protobuf definitions.
gitiles
Package gitiles contains Gitiles service definition.
Package gitiles contains Gitiles service definition.
gitiles/mock_gitiles
Package mock_gitiles is a generated GoMock package.
Package mock_gitiles is a generated GoMock package.
google/descutil
Package descutil contains utility functions for protobuf descriptor messages.
Package descutil contains utility functions for protobuf descriptor messages.
google/descutil/internal
Package internal is used exclusively for descutil own tests.
Package internal is used exclusively for descutil own tests.
mask
Package mask provides utility functions for google protobuf field masks.
Package mask provides utility functions for google protobuf field masks.
msgpackpb
Package msgpackpb implements generic protobuf message serialization to msgpack.
Package msgpackpb implements generic protobuf message serialization to msgpack.
msgpackpb/luagen
Package luagen implements a lua code generator for proto code.
Package luagen implements a lua code generator for proto code.
msgpackpb/luagen/examplepb
Package examplepb serves as an example protobuf library which is structured similarly to how other protobuf libraries in this repo are structured, with the addition of a generated .lua file output.
Package examplepb serves as an example protobuf library which is structured similarly to how other protobuf libraries in this repo are structured, with the addition of a generated .lua file output.
paged
Package paged implements a helper for making paginated Datastore queries.
Package paged implements a helper for making paginated Datastore queries.
protoc
Package protoc contains helpers for running `protoc` using protos files stored in the Go source tree.
Package protoc contains helpers for running `protoc` using protos files stored in the Go source tree.
protowalk
Package protowalk contains routines for efficiently walking proto messages, focusing on the ability to react to field annotations.
Package protowalk contains routines for efficiently walking proto messages, focusing on the ability to react to field annotations.
realms
Package realms contains LUCI Realms protobuf definitions.
Package realms contains LUCI Realms protobuf definitions.
reflectutil
Package reflectutil has an arbitrary assortment of helpers for dealing with protobuf reflection including:
Package reflectutil has an arbitrary assortment of helpers for dealing with protobuf reflection including:
sidecar
Package sidecar contains APIs exposed by LUCI Sidecar server.
Package sidecar contains APIs exposed by LUCI Sidecar server.
srcman
Package srcman contains source manifest protobuf definitions.
Package srcman contains source manifest protobuf definitions.
structmask
Package structmask implements a functionality similar to google.protobuf.FieldMask, but which applies only to google.protobuf.Struct.
Package structmask implements a functionality similar to google.protobuf.FieldMask, but which applies only to google.protobuf.Struct.
textpb
Package textpb can reformat text protos to be prettier.
Package textpb can reformat text protos to be prettier.
textpb/internal
Package internal contains protos used internally in tests.
Package internal contains protos used internally in tests.
transient
Package transient allows you to tag and retry 'transient' errors (i.e.
Package transient allows you to tag and retry 'transient' errors (i.e.
runtime
goroutine
Package goroutine is mostly to house a function for obtaining the current goroutine ID, but probably will eventually contain other naughty functions.
Package goroutine is mostly to house a function for obtaining the current goroutine ID, but probably will eventually contain other naughty functions.
paniccatcher
Package paniccatcher package exposes a set of utility structures and methods that support standardized panic catching and handling.
Package paniccatcher package exposes a set of utility structures and methods that support standardized panic catching and handling.
profiling
Package profiling provides a tool to profile various aspects of the process.
Package profiling provides a tool to profile various aspects of the process.
Package spantest implements TestMain for running tests that interact with Cloud Spanner.
Package spantest implements TestMain for running tests that interact with Cloud Spanner.
emulator
Package emulator knows how to launch Cloud Spanner emulator.
Package emulator knows how to launch Cloud Spanner emulator.
sync
dispatcher
Package dispatcher implements a super-charged version of a buffered channel connected to a (potentially) parallelized work dispatcher.
Package dispatcher implements a super-charged version of a buffered channel connected to a (potentially) parallelized work dispatcher.
dispatcher/buffer
Package buffer implements a batching buffer with batch lease and retry management.
Package buffer implements a batching buffer with batch lease and retry management.
mutexpool
Package mutexpool implements P, a pool of keyed mutexes.
Package mutexpool implements P, a pool of keyed mutexes.
system
environ
Package environ is an environment variable manipulation library.
Package environ is an environment variable manipulation library.
exec2
Package exec2 is like os/exec but supports timeout in Wait and process containment for unix using process group.
Package exec2 is like os/exec but supports timeout in Wait and process containment for unix using process group.
exitcode
Package exitcode provides common methods to extract exit codes from errors returned by exec.Cmd.
Package exitcode provides common methods to extract exit codes from errors returned by exec.Cmd.
pager
Package pager implements paging using commands "less" or "more", depending on availability.
Package pager implements paging using commands "less" or "more", depending on availability.
prober
Package prober exports Probe, which implements logic to identify a wrapper's wrapped target.
Package prober exports Probe, which implements logic to identify a wrapper's wrapped target.
shell
Package shell contains functions for quoting arguments to commands.
Package shell contains functions for quoting arguments to commands.
signals
Package signals makes it easier to catch SIGTERM.
Package signals makes it easier to catch SIGTERM.
terminal
Package terminal is just a way to forward
Package terminal is just a way to forward
testing
assertions
Package assertions is designed to be a collection of `.` importable, goconvey compatible testing assertions, in the style of "github.com/smarty/assertions".
Package assertions is designed to be a collection of `.` importable, goconvey compatible testing assertions, in the style of "github.com/smarty/assertions".
ftt
Package ftt (aka "from the top") replicates the test exectution order semantics of `github.com/smartystreets/goconvey/convey` while fixing some notable issues:
Package ftt (aka "from the top") replicates the test exectution order semantics of `github.com/smartystreets/goconvey/convey` while fixing some notable issues:
httpmitm
Package httpmitm contains an HTTP client that logs all incoming and outgoing requests.
Package httpmitm contains an HTTP client that logs all incoming and outgoing requests.
mock
Package mock has utility functions for gomock.
Package mock has utility functions for gomock.
prpctest
Package prpctest is a package to facilitate pRPC testing by wrapping httptest with a pRPC Server.
Package prpctest is a package to facilitate pRPC testing by wrapping httptest with a pRPC Server.
registry
Package registry provides a way to register options to cmp.Diff.
Package registry provides a way to register options to cmp.Diff.
testfs
Package testfs implements a test filesystem.
Package testfs implements a test filesystem.
truth
Package truth implements an extensible, simple, assertion library for Go with minimal dependencies.
Package truth implements an extensible, simple, assertion library for Go with minimal dependencies.
truth/assert
Package assert contains two functions, which allow you to make fluent truth comparisons which t.FailNow a test.
Package assert contains two functions, which allow you to make fluent truth comparisons which t.FailNow a test.
truth/check
Package check contains two functions, which allow you to make fluent truth comparisons which t.Fail a test.
Package check contains two functions, which allow you to make fluent truth comparisons which t.Fail a test.
truth/comparison
Package comparison contains symbols for making your own comparison.Func implementations for use with go.chromium.org/luci/common/testing/truth.
Package comparison contains symbols for making your own comparison.Func implementations for use with go.chromium.org/luci/common/testing/truth.
truth/convey
Package convey provides a temporary symbol which converts a convey-style comparison of the type:
Package convey provides a temporary symbol which converts a convey-style comparison of the type:
truth/convey/facade
Package facade is a transitional package that mimics the API of GoConvey classic.
Package facade is a transitional package that mimics the API of GoConvey classic.
truth/should
Package should contains comparisons such as should.Equal to be used with the "go.chromium.org/luci/common/testing/truth" library.
Package should contains comparisons such as should.Equal to be used with the "go.chromium.org/luci/common/testing/truth" library.
typed
Package typed is a strictly typed wrapper around cmp.Diff.
Package typed is a strictly typed wrapper around cmp.Diff.
Package tsmon contains global state and utility functions for configuring and interacting with tsmon.
Package tsmon contains global state and utility functions for configuring and interacting with tsmon.
distribution
Package distribution contains distribution metrics, fixed width and geometric bucketers.
Package distribution contains distribution metrics, fixed width and geometric bucketers.
examples/beep
package dummy_project implements a demo application that populates monitoring data for a dummy_project.
package dummy_project implements a demo application that populates monitoring data for a dummy_project.
examples/beep/dummy_project
dummy_project implements a monitoring target interface for DummyProject.
dummy_project implements a monitoring target interface for DummyProject.
field
Package field contains constructors for metric field definitions.
Package field contains constructors for metric field definitions.
metric
Package metric is the API for defining metrics and updating their values.
Package metric is the API for defining metrics and updating their values.
monitor
Package monitor contains the code for sending metric data to monitoring endpoints.
Package monitor contains the code for sending metric data to monitoring endpoints.
registry
Package registry holds a map of all metrics registered by the process.
Package registry holds a map of all metrics registered by the process.
runtimestats
Package runtimestats exposes metrics related to the Go runtime.
Package runtimestats exposes metrics related to the Go runtime.
store
Package store contains code for storing and retrieving metrics.
Package store contains code for storing and retrieving metrics.
store/storetest
Package storetest is imported exclusively by tests for Store implementations.
Package storetest is imported exclusively by tests for Store implementations.
target
Package target contains information about the thing that is sending metrics - either a NetworkDevice (a machine) or a Task (a service).
Package target contains information about the thing that is sending metrics - either a NetworkDevice (a machine) or a Task (a service).
ts_mon_proto
Package ts_mon_proto contains ts_mon protobuf source and generated protobuf data.
Package ts_mon_proto contains ts_mon protobuf source and generated protobuf data.
types
Package types contains miscellaneous structs and interfaces used throughout tsmon.
Package types contains miscellaneous structs and interfaces used throughout tsmon.
versions
Package versions allows processes to report string-valued metrics with versions of various libraries they link with.
Package versions allows processes to report string-valued metrics with versions of various libraries they link with.
Package validate contains methods for validating inputs.
Package validate contains methods for validating inputs.

Jump to

Keyboard shortcuts

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