luci: Index | Files

package textproto

import ""

Package textproto implements a textproto config service Resolver.

It uses the "luci-go" text protobuf multi-line extension. For more information, see:

The textproto protobuf Resolver internally formats its content as a binary protobuf, rather than its raw text content. This has some advantages over raw text content caching:

- More space-efficient.
- Decodes faster.
- If the config service protobuf schema differs from the application's
  compiled schema, and the schema change is responsible (adding, renaming,
  repurposing) the binary cache value will continue to load where the text
  protobuf would fail.



Package Files



const BinaryFormat = ""

BinaryFormat is the resolver's binary protobuf format string.

func Message Uses

func Message(out proto.Message) interface {

Message is a cfgclient.Resolver that resolves config data into proto.Message instances by parsing the config data as a text protobuf.

func Slice Uses

func Slice(out interface{}) interface {

Slice is a cfgclient.MultiResolver which resolves a slice of configurations into a TextProto.

out must be a pointer to a slice of some proto.Message implementation. If it isn't, this function will panic.

For example:

var out []*MyProtoMessages

type Formatter Uses

type Formatter struct{}

Formatter is a cfgclient.Formatter implementation bound to a specific protobuf message.

It takes a text protobuf representation of that message as input and returns a binary protobuf representation as output.

func (*Formatter) FormatItem Uses

func (f *Formatter) FormatItem(c, fd string) (string, error)

FormatItem implements cfgclient.Formatter.

Package textproto imports 10 packages (graph) and is imported by 23 packages. Updated 2020-04-06. Refresh now. Tools for package owners.