luci: go.chromium.org/luci/config/server/cfgclient/textproto Index | Files

package textproto

import "go.chromium.org/luci/config/server/cfgclient/textproto"

Package textproto implements a textproto config service Resolver.

It uses the "luci-go" text protobuf multi-line extension. For more information, see: go.chromium.org/luci/common/proto

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.

Index

Package Files

resolver.go

Constants

const BinaryFormat = "go.chromium.org/luci/server/config/TextProto:binary"

BinaryFormat is the resolver's binary protobuf format string.

func Message Uses

func Message(out proto.Message) interface {
    cfgclient.Resolver
    cfgclient.FormattingResolver
}

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 {
    cfgclient.MultiResolver
    cfgclient.FormattingResolver
}

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
TextProtoSlice(&out)

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 20 packages. Updated 2018-10-19. Refresh now. Tools for package owners.