google-protobuf: go.pedge.io/google-protobuf Index | Files

package google_protobuf

import "go.pedge.io/google-protobuf"

Package google_protobuf is a generated protocol buffer package.

It is generated from these files:

google/protobuf/any.proto
google/protobuf/api.proto
google/protobuf/duration.proto
google/protobuf/empty.proto
google/protobuf/field_mask.proto
google/protobuf/source_context.proto
google/protobuf/struct.proto
google/protobuf/timestamp.proto
google/protobuf/type.proto
google/protobuf/wrappers.proto

It has these top-level messages:

Any
Api
Method
Mixin
Duration
Empty
FieldMask
SourceContext
Struct
Value
ListValue
Timestamp
Type
Field
Enum
EnumValue
Option
DoubleValue
FloatValue
Int64Value
UInt64Value
Int32Value
UInt32Value
BoolValue
StringValue
BytesValue

Index

Package Files

any.pb.go api.pb.go duration.pb.go empty.pb.go field_mask.pb.go google_protobuf.go source_context.pb.go struct.pb.go timestamp.pb.go type.pb.go wrappers.pb.go

Variables

var (
    // EmptyInstance is an instance of *Empty.
    EmptyInstance = &Empty{}
)
var Field_Cardinality_name = map[int32]string{
    0:  "CARDINALITY_UNKNOWN",
    1:  "CARDINALITY_OPTIONAL",
    2:  "CARDINALITY_REQUIRED",
    3:  "CARDINALITY_REPEATED",
}
var Field_Cardinality_value = map[string]int32{
    "CARDINALITY_UNKNOWN":  0,
    "CARDINALITY_OPTIONAL": 1,
    "CARDINALITY_REQUIRED": 2,
    "CARDINALITY_REPEATED": 3,
}
var Field_Kind_name = map[int32]string{
    0:  "TYPE_UNKNOWN",
    1:  "TYPE_DOUBLE",
    2:  "TYPE_FLOAT",
    3:  "TYPE_INT64",
    4:  "TYPE_UINT64",
    5:  "TYPE_INT32",
    6:  "TYPE_FIXED64",
    7:  "TYPE_FIXED32",
    8:  "TYPE_BOOL",
    9:  "TYPE_STRING",
    10: "TYPE_GROUP",
    11: "TYPE_MESSAGE",
    12: "TYPE_BYTES",
    13: "TYPE_UINT32",
    14: "TYPE_ENUM",
    15: "TYPE_SFIXED32",
    16: "TYPE_SFIXED64",
    17: "TYPE_SINT32",
    18: "TYPE_SINT64",
}
var Field_Kind_value = map[string]int32{
    "TYPE_UNKNOWN":  0,
    "TYPE_DOUBLE":   1,
    "TYPE_FLOAT":    2,
    "TYPE_INT64":    3,
    "TYPE_UINT64":   4,
    "TYPE_INT32":    5,
    "TYPE_FIXED64":  6,
    "TYPE_FIXED32":  7,
    "TYPE_BOOL":     8,
    "TYPE_STRING":   9,
    "TYPE_GROUP":    10,
    "TYPE_MESSAGE":  11,
    "TYPE_BYTES":    12,
    "TYPE_UINT32":   13,
    "TYPE_ENUM":     14,
    "TYPE_SFIXED32": 15,
    "TYPE_SFIXED64": 16,
    "TYPE_SINT32":   17,
    "TYPE_SINT64":   18,
}
var NullValue_name = map[int32]string{
    0: "NULL_VALUE",
}
var NullValue_value = map[string]int32{
    "NULL_VALUE": 0,
}
var Syntax_name = map[int32]string{
    0:  "SYNTAX_PROTO2",
    1:  "SYNTAX_PROTO3",
}
var Syntax_value = map[string]int32{
    "SYNTAX_PROTO2": 0,
    "SYNTAX_PROTO3": 1,
}

type Any Uses

type Any struct {
    // A URL/resource name whose content describes the type of the
    // serialized message.
    //
    // For URLs which use the schema `http`, `https`, or no schema, the
    // following restrictions and interpretations apply:
    //
    // * If no schema is provided, `https` is assumed.
    // * The last segment of the URL's path must represent the fully
    //   qualified name of the type (as in `path/google.protobuf.Duration`).
    // * An HTTP GET on the URL must yield a [google.protobuf.Type][google.protobuf.Type]
    //   value in binary format, or produce an error.
    // * Applications are allowed to cache lookup results based on the
    //   URL, or have them precompiled into a binary to avoid any
    //   lookup. Therefore, binary compatibility needs to be preserved
    //   on changes to types. (Use versioned type names to manage
    //   breaking changes.)
    //
    // Schemas other than `http`, `https` (or the empty schema) might be
    // used with implementation specific semantics.
    //
    TypeUrl string `protobuf:"bytes,1,opt,name=type_url" json:"type_url,omitempty"`
    // Must be valid serialized data of the above specified type.
    Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

`Any` contains an arbitrary serialized message along with a URL that describes the type of the serialized message.

JSON ==== The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example:

package google.profile;
message Person {
  string first_name = 1;
  string last_name = 2;
}

{
  "@type": "type.googleapis.com/google.profile.Person",
  "firstName": <string>,
  "lastName": <string>
}

If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the the `@type` field. Example (for message [google.protobuf.Duration][google.protobuf.Duration]):

{
  "@type": "type.googleapis.com/google.protobuf.Duration",
  "value": "1.212s"
}

func (*Any) Descriptor Uses

func (*Any) Descriptor() ([]byte, []int)

func (*Any) ProtoMessage Uses

func (*Any) ProtoMessage()

func (*Any) Reset Uses

func (m *Any) Reset()

func (*Any) String Uses

func (m *Any) String() string

type Api Uses

type Api struct {
    // The fully qualified name of this api, including package name
    // followed by the api's simple name.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
    // The methods of this api, in unspecified order.
    Methods []*Method `protobuf:"bytes,2,rep,name=methods" json:"methods,omitempty"`
    // Any metadata attached to the API.
    Options []*Option `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"`
    // A version string for this api. If specified, must have the form
    // `major-version.minor-version`, as in `1.10`. If the minor version
    // is omitted, it defaults to zero. If the entire version field is
    // empty, the major version is derived from the package name, as
    // outlined below. If the field is not empty, the version in the
    // package name will be verified to be consistent with what is
    // provided here.
    //
    // The versioning schema uses [semantic
    // versioning](http://semver.org) where the major version number
    // indicates a breaking change and the minor version an additive,
    // non-breaking change. Both version numbers are signals to users
    // what to expect from different versions, and should be carefully
    // chosen based on the product plan.
    //
    // The major version is also reflected in the package name of the
    // API, which must end in `v<major-version>`, as in
    // `google.feature.v1`. For major versions 0 and 1, the suffix can
    // be omitted. Zero major versions must only be used for
    // experimental, none-GA apis.
    //
    Version string `protobuf:"bytes,4,opt,name=version" json:"version,omitempty"`
    // Source context for the protocol buffer service represented by this
    // message.
    SourceContext *SourceContext `protobuf:"bytes,5,opt,name=source_context" json:"source_context,omitempty"`
    // Included APIs. See [Mixin][].
    Mixins []*Mixin `protobuf:"bytes,6,rep,name=mixins" json:"mixins,omitempty"`
    // The source syntax of the service.
    Syntax Syntax `protobuf:"varint,7,opt,name=syntax,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
}

Api is a light-weight descriptor for a protocol buffer service.

func (*Api) Descriptor Uses

func (*Api) Descriptor() ([]byte, []int)

func (*Api) GetMethods Uses

func (m *Api) GetMethods() []*Method

func (*Api) GetMixins Uses

func (m *Api) GetMixins() []*Mixin

func (*Api) GetOptions Uses

func (m *Api) GetOptions() []*Option

func (*Api) GetSourceContext Uses

func (m *Api) GetSourceContext() *SourceContext

func (*Api) ProtoMessage Uses

func (*Api) ProtoMessage()

func (*Api) Reset Uses

func (m *Api) Reset()

func (*Api) String Uses

func (m *Api) String() string

type BoolValue Uses

type BoolValue struct {
    // The bool value.
    Value bool `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
}

Wrapper message for `bool`.

The JSON representation for `BoolValue` is JSON `true` and `false`.

func (*BoolValue) Descriptor Uses

func (*BoolValue) Descriptor() ([]byte, []int)

func (*BoolValue) ProtoMessage Uses

func (*BoolValue) ProtoMessage()

func (*BoolValue) Reset Uses

func (m *BoolValue) Reset()

func (*BoolValue) String Uses

func (m *BoolValue) String() string

type BytesValue Uses

type BytesValue struct {
    // The bytes value.
    Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
}

Wrapper message for `bytes`.

The JSON representation for `BytesValue` is JSON string.

func (*BytesValue) Descriptor Uses

func (*BytesValue) Descriptor() ([]byte, []int)

func (*BytesValue) ProtoMessage Uses

func (*BytesValue) ProtoMessage()

func (*BytesValue) Reset Uses

func (m *BytesValue) Reset()

func (*BytesValue) String Uses

func (m *BytesValue) String() string

type DoubleValue Uses

type DoubleValue struct {
    // The double value.
    Value float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"`
}

Wrapper message for `double`.

The JSON representation for `DoubleValue` is JSON number.

func (*DoubleValue) Descriptor Uses

func (*DoubleValue) Descriptor() ([]byte, []int)

func (*DoubleValue) ProtoMessage Uses

func (*DoubleValue) ProtoMessage()

func (*DoubleValue) Reset Uses

func (m *DoubleValue) Reset()

func (*DoubleValue) String Uses

func (m *DoubleValue) String() string

type Duration Uses

type Duration struct {
    // Signed seconds of the span of time. Must be from -315,576,000,000
    // to +315,576,000,000 inclusive.
    Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
    // Signed fractions of a second at nanosecond resolution of the span
    // of time. Durations less than one second are represented with a 0
    // `seconds` field and a positive or negative `nanos` field. For durations
    // of one second or more, a non-zero value for the `nanos` field must be
    // of the same sign as the `seconds` field. Must be from -999,999,999
    // to +999,999,999 inclusive.
    Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
}

A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years.

Example 1: Compute Duration from two Timestamps in pseudo code.

Timestamp start = ...;
Timestamp end = ...;
Duration duration = ...;

duration.seconds = end.seconds - start.seconds;
duration.nanos = end.nanos - start.nanos;

if (duration.seconds < 0 && duration.nanos > 0) {
  duration.seconds += 1;
  duration.nanos -= 1000000000;
} else if (durations.seconds > 0 && duration.nanos < 0) {
  duration.seconds -= 1;
  duration.nanos += 1000000000;
}

Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.

Timestamp start = ...;
Duration duration = ...;
Timestamp end = ...;

end.seconds = start.seconds + duration.seconds;
end.nanos = start.nanos + duration.nanos;

if (end.nanos < 0) {
  end.seconds -= 1;
  end.nanos += 1000000000;
} else if (end.nanos >= 1000000000) {
  end.seconds += 1;
  end.nanos -= 1000000000;
}

func (*Duration) Descriptor Uses

func (*Duration) Descriptor() ([]byte, []int)

func (*Duration) ProtoMessage Uses

func (*Duration) ProtoMessage()

func (*Duration) Reset Uses

func (m *Duration) Reset()

func (*Duration) String Uses

func (m *Duration) String() string

type Empty Uses

type Empty struct {
}

A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:

service Foo {
  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
}

The JSON representation for `Empty` is empty JSON object `{}`.

func (*Empty) Descriptor Uses

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage Uses

func (*Empty) ProtoMessage()

func (*Empty) Reset Uses

func (m *Empty) Reset()

func (*Empty) String Uses

func (m *Empty) String() string

type Enum Uses

type Enum struct {
    // Enum type name.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
    // Enum value definitions.
    Enumvalue []*EnumValue `protobuf:"bytes,2,rep,name=enumvalue" json:"enumvalue,omitempty"`
    // Proto options for the enum type.
    Options []*Option `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"`
    // The source context.
    SourceContext *SourceContext `protobuf:"bytes,4,opt,name=source_context" json:"source_context,omitempty"`
    // The source syntax.
    Syntax Syntax `protobuf:"varint,5,opt,name=syntax,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
}

Enum type definition.

func (*Enum) Descriptor Uses

func (*Enum) Descriptor() ([]byte, []int)

func (*Enum) GetEnumvalue Uses

func (m *Enum) GetEnumvalue() []*EnumValue

func (*Enum) GetOptions Uses

func (m *Enum) GetOptions() []*Option

func (*Enum) GetSourceContext Uses

func (m *Enum) GetSourceContext() *SourceContext

func (*Enum) ProtoMessage Uses

func (*Enum) ProtoMessage()

func (*Enum) Reset Uses

func (m *Enum) Reset()

func (*Enum) String Uses

func (m *Enum) String() string

type EnumValue Uses

type EnumValue struct {
    // Enum value name.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
    // Enum value number.
    Number int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"`
    // Proto options for the enum value.
    Options []*Option `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"`
}

Enum value definition.

func (*EnumValue) Descriptor Uses

func (*EnumValue) Descriptor() ([]byte, []int)

func (*EnumValue) GetOptions Uses

func (m *EnumValue) GetOptions() []*Option

func (*EnumValue) ProtoMessage Uses

func (*EnumValue) ProtoMessage()

func (*EnumValue) Reset Uses

func (m *EnumValue) Reset()

func (*EnumValue) String Uses

func (m *EnumValue) String() string

type Field Uses

type Field struct {
    // The field kind.
    Kind Field_Kind `protobuf:"varint,1,opt,name=kind,enum=google.protobuf.Field_Kind" json:"kind,omitempty"`
    // The field cardinality, i.e. optional/required/repeated.
    Cardinality Field_Cardinality `protobuf:"varint,2,opt,name=cardinality,enum=google.protobuf.Field_Cardinality" json:"cardinality,omitempty"`
    // The proto field number.
    Number int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"`
    // The field name.
    Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"`
    // The type URL (without the scheme) when the type is MESSAGE or ENUM,
    // such as `type.googleapis.com/google.protobuf.Empty`.
    TypeUrl string `protobuf:"bytes,6,opt,name=type_url" json:"type_url,omitempty"`
    // Index in Type.oneofs. Starts at 1. Zero means no oneof mapping.
    OneofIndex int32 `protobuf:"varint,7,opt,name=oneof_index" json:"oneof_index,omitempty"`
    // Whether to use alternative packed wire representation.
    Packed bool `protobuf:"varint,8,opt,name=packed" json:"packed,omitempty"`
    // The proto options.
    Options []*Option `protobuf:"bytes,9,rep,name=options" json:"options,omitempty"`
    // The JSON name for this field.
    JsonName string `protobuf:"bytes,10,opt,name=json_name" json:"json_name,omitempty"`
}

Field represents a single field of a message type.

func (*Field) Descriptor Uses

func (*Field) Descriptor() ([]byte, []int)

func (*Field) GetOptions Uses

func (m *Field) GetOptions() []*Option

func (*Field) ProtoMessage Uses

func (*Field) ProtoMessage()

func (*Field) Reset Uses

func (m *Field) Reset()

func (*Field) String Uses

func (m *Field) String() string

type FieldMask Uses

type FieldMask struct {
    // The set of field mask paths.
    Paths []string `protobuf:"bytes,1,rep,name=paths" json:"paths,omitempty"`
}

`FieldMask` represents a set of symbolic field paths, for example:

paths: "f.a"
paths: "f.b.d"

Here `f` represents a field in some root message, `a` and `b` fields in the message found in `f`, and `d` a field found in the message in `f.b`.

Field masks are used to specify a subset of fields that should be returned by a get operation or modified by an update operation. Field masks also have a custom JSON encoding (see below).

# Field Masks in Projections

When used in the context of a projection, a response message or sub-message is filtered by the API to only contain those fields as specified in the mask. For example, if the mask in the previous example is applied to a response message as follows:

f {
  a : 22
  b {
    d : 1
    x : 2
  }
  y : 13
}
z: 8

The result will not contain specific values for fields x,y and z (there value will be set to the default, and omitted in proto text output):

f {
  a : 22
  b {
    d : 1
  }
}

A repeated field is not allowed except at the last position of a field mask.

If a FieldMask object is not present in a get operation, the operation applies to all fields (as if a FieldMask of all fields had been specified).

Note that a field mask does not necessarily applies to the top-level response message. In case of a REST get operation, the field mask applies directly to the response, but in case of a REST list operation, the mask instead applies to each individual message in the returned resource list. In case of a REST custom method, other definitions may be used. Where the mask applies will be clearly documented together with its declaration in the API. In any case, the effect on the returned resource/resources is required behavior for APIs.

# Field Masks in Update Operations

A field mask in update operations specifies which fields of the targeted resource are going to be updated. The API is required to only change the values of the fields as specified in the mask and leave the others untouched. If a resource is passed in to describe the updated values, the API ignores the values of all fields not covered by the mask.

In order to reset a field's value to the default, the field must be in the mask and set to the default value in the provided resource. Hence, in order to reset all fields of a resource, provide a default instance of the resource and set all fields in the mask, or do not provide a mask as described below.

If a field mask is not present on update, the operation applies to all fields (as if a field mask of all fields has been specified). Note that in the presence of schema evolution, this may mean that fields the client does not know and has therefore not filled into the request will be reset to their default. If this is unwanted behavior, a specific service may require a client to always specify a field mask, producing an error if not.

As with get operations, the location of the resource which describes the updated values in the request message depends on the operation kind. In any case, the effect of the field mask is required to be honored by the API.

## Considerations for HTTP REST

The HTTP kind of an update operation which uses a field mask must be set to PATCH instead of PUT in order to satisfy HTTP semantics (PUT must only be used for full updates).

# JSON Encoding of Field Masks

In JSON, a field mask is encoded as a single string where paths are separated by a comma. Fields name in each path are converted to/from lower-camel naming conventions.

As an example, consider the following message declarations:

message Profile {
  User user = 1;
  Photo photo = 2;
}
message User {
  string display_name = 1;
  string address = 2;
}

In proto a field mask for `Profile` may look as such:

mask {
  paths: "user.display_name"
  paths: "photo"
}

In JSON, the same mask is represented as below:

{
  mask: "user.displayName,photo"
}

func (*FieldMask) Descriptor Uses

func (*FieldMask) Descriptor() ([]byte, []int)

func (*FieldMask) ProtoMessage Uses

func (*FieldMask) ProtoMessage()

func (*FieldMask) Reset Uses

func (m *FieldMask) Reset()

func (*FieldMask) String Uses

func (m *FieldMask) String() string

type Field_Cardinality Uses

type Field_Cardinality int32

Cardinality represents whether a field is optional, required, or repeated.

const (
    // The field cardinality is unknown. Typically an error condition.
    Field_CARDINALITY_UNKNOWN Field_Cardinality = 0
    // For optional fields.
    Field_CARDINALITY_OPTIONAL Field_Cardinality = 1
    // For required fields. Not used for proto3.
    Field_CARDINALITY_REQUIRED Field_Cardinality = 2
    // For repeated fields.
    Field_CARDINALITY_REPEATED Field_Cardinality = 3
)

func (Field_Cardinality) EnumDescriptor Uses

func (Field_Cardinality) EnumDescriptor() ([]byte, []int)

func (Field_Cardinality) String Uses

func (x Field_Cardinality) String() string

type Field_Kind Uses

type Field_Kind int32

Kind represents a basic field type.

const (
    // Field type unknown.
    Field_TYPE_UNKNOWN Field_Kind = 0
    // Field type double.
    Field_TYPE_DOUBLE Field_Kind = 1
    // Field type float.
    Field_TYPE_FLOAT Field_Kind = 2
    // Field type int64.
    Field_TYPE_INT64 Field_Kind = 3
    // Field type uint64.
    Field_TYPE_UINT64 Field_Kind = 4
    // Field type int32.
    Field_TYPE_INT32 Field_Kind = 5
    // Field type fixed64.
    Field_TYPE_FIXED64 Field_Kind = 6
    // Field type fixed32.
    Field_TYPE_FIXED32 Field_Kind = 7
    // Field type bool.
    Field_TYPE_BOOL Field_Kind = 8
    // Field type string.
    Field_TYPE_STRING Field_Kind = 9
    // Field type group (deprecated proto2 type)
    Field_TYPE_GROUP Field_Kind = 10
    // Field type message.
    Field_TYPE_MESSAGE Field_Kind = 11
    // Field type bytes.
    Field_TYPE_BYTES Field_Kind = 12
    // Field type uint32.
    Field_TYPE_UINT32 Field_Kind = 13
    // Field type enum.
    Field_TYPE_ENUM Field_Kind = 14
    // Field type sfixed32.
    Field_TYPE_SFIXED32 Field_Kind = 15
    // Field type sfixed64.
    Field_TYPE_SFIXED64 Field_Kind = 16
    // Field type sint32.
    Field_TYPE_SINT32 Field_Kind = 17
    // Field type sint64.
    Field_TYPE_SINT64 Field_Kind = 18
)

func (Field_Kind) EnumDescriptor Uses

func (Field_Kind) EnumDescriptor() ([]byte, []int)

func (Field_Kind) String Uses

func (x Field_Kind) String() string

type FloatValue Uses

type FloatValue struct {
    // The float value.
    Value float32 `protobuf:"fixed32,1,opt,name=value" json:"value,omitempty"`
}

Wrapper message for `float`.

The JSON representation for `FloatValue` is JSON number.

func (*FloatValue) Descriptor Uses

func (*FloatValue) Descriptor() ([]byte, []int)

func (*FloatValue) ProtoMessage Uses

func (*FloatValue) ProtoMessage()

func (*FloatValue) Reset Uses

func (m *FloatValue) Reset()

func (*FloatValue) String Uses

func (m *FloatValue) String() string

type Int32Value Uses

type Int32Value struct {
    // The int32 value.
    Value int32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
}

Wrapper message for `int32`.

The JSON representation for `Int32Value` is JSON number.

func (*Int32Value) Descriptor Uses

func (*Int32Value) Descriptor() ([]byte, []int)

func (*Int32Value) ProtoMessage Uses

func (*Int32Value) ProtoMessage()

func (*Int32Value) Reset Uses

func (m *Int32Value) Reset()

func (*Int32Value) String Uses

func (m *Int32Value) String() string

type Int64Value Uses

type Int64Value struct {
    // The int64 value.
    Value int64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
}

Wrapper message for `int64`.

The JSON representation for `Int64Value` is JSON string.

func (*Int64Value) Descriptor Uses

func (*Int64Value) Descriptor() ([]byte, []int)

func (*Int64Value) ProtoMessage Uses

func (*Int64Value) ProtoMessage()

func (*Int64Value) Reset Uses

func (m *Int64Value) Reset()

func (*Int64Value) String Uses

func (m *Int64Value) String() string

type ListValue Uses

type ListValue struct {
    // Repeated field of dynamically typed values.
    Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"`
}

`ListValue` is a wrapper around a repeated field of values.

The JSON representation for `ListValue` is JSON array.

func (*ListValue) Descriptor Uses

func (*ListValue) Descriptor() ([]byte, []int)

func (*ListValue) GetValues Uses

func (m *ListValue) GetValues() []*Value

func (*ListValue) ProtoMessage Uses

func (*ListValue) ProtoMessage()

func (*ListValue) Reset Uses

func (m *ListValue) Reset()

func (*ListValue) String Uses

func (m *ListValue) String() string

type Method Uses

type Method struct {
    // The simple name of this method.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
    // A URL of the input message type.
    RequestTypeUrl string `protobuf:"bytes,2,opt,name=request_type_url" json:"request_type_url,omitempty"`
    // If true, the request is streamed.
    RequestStreaming bool `protobuf:"varint,3,opt,name=request_streaming" json:"request_streaming,omitempty"`
    // The URL of the output message type.
    ResponseTypeUrl string `protobuf:"bytes,4,opt,name=response_type_url" json:"response_type_url,omitempty"`
    // If true, the response is streamed.
    ResponseStreaming bool `protobuf:"varint,5,opt,name=response_streaming" json:"response_streaming,omitempty"`
    // Any metadata attached to the method.
    Options []*Option `protobuf:"bytes,6,rep,name=options" json:"options,omitempty"`
    // The source syntax of this method.
    Syntax Syntax `protobuf:"varint,7,opt,name=syntax,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
}

Method represents a method of an api.

func (*Method) Descriptor Uses

func (*Method) Descriptor() ([]byte, []int)

func (*Method) GetOptions Uses

func (m *Method) GetOptions() []*Option

func (*Method) ProtoMessage Uses

func (*Method) ProtoMessage()

func (*Method) Reset Uses

func (m *Method) Reset()

func (*Method) String Uses

func (m *Method) String() string

type Mixin Uses

type Mixin struct {
    // The fully qualified name of the API which is included.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
    // If non-empty specifies a path under which inherited HTTP paths
    // are rooted.
    Root string `protobuf:"bytes,2,opt,name=root" json:"root,omitempty"`
}

Declares an API to be included in this API. The including API must redeclare all the methods from the included API, but documentation and options are inherited as follows:

- If after comment and whitespace stripping, the documentation

string of the redeclared method is empty, it will be inherited
from the original method.

- Each annotation belonging to the service config (http,

visibility) which is not set in the redeclared method will be
inherited.

- If an http annotation is inherited, the path pattern will be

modified as follows. Any version prefix will be replaced by the
version of the including API plus the [root][] path if specified.

Example of a simple mixin:

package google.acl.v1;
service AccessControl {
  // Get the underlying ACL object.
  rpc GetAcl(GetAclRequest) returns (Acl) {
    option (google.api.http).get = "/v1/{resource=**}:getAcl";
  }
}

package google.storage.v2;
service Storage {
  // (-- see AccessControl.GetAcl --)
  rpc GetAcl(GetAclRequest) returns (Acl);

  // Get a data record.
  rpc GetData(GetDataRequest) returns (Data) {
    option (google.api.http).get = "/v2/{resource=**}";
  }
}

Example of a mixin configuration:

apis:
- name: google.storage.v2.Storage
  mixins:
  - name: google.acl.v1.AccessControl

The mixin construct implies that all methods in `AccessControl` are also declared with same name and request/response types in `Storage`. A documentation generator or annotation processor will see the effective `Storage.GetAcl` method after inherting documentation and annotations as follows:

service Storage {
  // Get the underlying ACL object.
  rpc GetAcl(GetAclRequest) returns (Acl) {
    option (google.api.http).get = "/v2/{resource=**}:getAcl";
  }
  ...
}

Note how the version in the path pattern changed from `v1` to `v2`.

If the `root` field in the mixin is specified, it should be a relative path under which inherited HTTP paths are placed. Example:

apis:
- name: google.storage.v2.Storage
  mixins:
  - name: google.acl.v1.AccessControl
    root: acls

This implies the following inherited HTTP annotation:

service Storage {
  // Get the underlying ACL object.
  rpc GetAcl(GetAclRequest) returns (Acl) {
    option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
  }
  ...
}

func (*Mixin) Descriptor Uses

func (*Mixin) Descriptor() ([]byte, []int)

func (*Mixin) ProtoMessage Uses

func (*Mixin) ProtoMessage()

func (*Mixin) Reset Uses

func (m *Mixin) Reset()

func (*Mixin) String Uses

func (m *Mixin) String() string

type NullValue Uses

type NullValue int32

`NullValue` is a singleton enumeration to represent the null value for the `Value` type union.

The JSON representation for `NullValue` is JSON `null`.
const (
    // Null value.
    NullValue_NULL_VALUE NullValue = 0
)

func (NullValue) EnumDescriptor Uses

func (NullValue) EnumDescriptor() ([]byte, []int)

func (NullValue) String Uses

func (x NullValue) String() string

type Option Uses

type Option struct {
    // Proto option name.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
    // Proto option value.
    Value *Any `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}

Proto option attached to messages/fields/enums etc.

func (*Option) Descriptor Uses

func (*Option) Descriptor() ([]byte, []int)

func (*Option) GetValue Uses

func (m *Option) GetValue() *Any

func (*Option) ProtoMessage Uses

func (*Option) ProtoMessage()

func (*Option) Reset Uses

func (m *Option) Reset()

func (*Option) String Uses

func (m *Option) String() string

type SourceContext Uses

type SourceContext struct {
    // The path-qualified name of the .proto file that contained the associated
    // protobuf element.  For example: `"google/protobuf/source.proto"`.
    FileName string `protobuf:"bytes,1,opt,name=file_name" json:"file_name,omitempty"`
}

`SourceContext` represents information about the source of a protobuf element, like the file in which it is defined.

func (*SourceContext) Descriptor Uses

func (*SourceContext) Descriptor() ([]byte, []int)

func (*SourceContext) ProtoMessage Uses

func (*SourceContext) ProtoMessage()

func (*SourceContext) Reset Uses

func (m *SourceContext) Reset()

func (*SourceContext) String Uses

func (m *SourceContext) String() string

type StringValue Uses

type StringValue struct {
    // The string value.
    Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
}

Wrapper message for `string`.

The JSON representation for `StringValue` is JSON string.

func (*StringValue) Descriptor Uses

func (*StringValue) Descriptor() ([]byte, []int)

func (*StringValue) ProtoMessage Uses

func (*StringValue) ProtoMessage()

func (*StringValue) Reset Uses

func (m *StringValue) Reset()

func (*StringValue) String Uses

func (m *StringValue) String() string

type Struct Uses

type Struct struct {
    // Map of dynamically typed values.
    Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}

`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language.

The JSON representation for `Struct` is JSON object.

func (*Struct) Descriptor Uses

func (*Struct) Descriptor() ([]byte, []int)

func (*Struct) GetFields Uses

func (m *Struct) GetFields() map[string]*Value

func (*Struct) ProtoMessage Uses

func (*Struct) ProtoMessage()

func (*Struct) Reset Uses

func (m *Struct) Reset()

func (*Struct) String Uses

func (m *Struct) String() string

type Syntax Uses

type Syntax int32

Syntax specifies the syntax in which a service element was defined.

const (
    // Syntax "proto2"
    Syntax_SYNTAX_PROTO2 Syntax = 0
    // Syntax "proto3"
    Syntax_SYNTAX_PROTO3 Syntax = 1
)

func (Syntax) EnumDescriptor Uses

func (Syntax) EnumDescriptor() ([]byte, []int)

func (Syntax) String Uses

func (x Syntax) String() string

type Timestamp Uses

type Timestamp struct {
    // Represents seconds of UTC time since Unix epoch
    // 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
    // 9999-12-31T23:59:59Z inclusive.
    Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
    // Non-negative fractions of a second at nanosecond resolution. Negative
    // second values with fractions must still have non-negative nanos values
    // that count forward in time. Must be from 0 to 999,999,999
    // inclusive.
    Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
}

A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings. See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).

Example 1: Compute Timestamp from POSIX `time()`.

Timestamp timestamp;
timestamp.set_seconds(time(NULL));
timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX `gettimeofday()`.

struct timeval tv;
gettimeofday(&tv, NULL);

Timestamp timestamp;
timestamp.set_seconds(tv.tv_sec);
timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.

FILETIME ft;
GetSystemTimeAsFileTime(&ft);
UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

// A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
Timestamp timestamp;
timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.

long millis = System.currentTimeMillis();

Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
    .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from current time in Python.

now = time.time()
seconds = int(now)
nanos = int((now - seconds) * 10**9)
timestamp = Timestamp(seconds=seconds, nanos=nanos)

func (*Timestamp) Descriptor Uses

func (*Timestamp) Descriptor() ([]byte, []int)

func (*Timestamp) ProtoMessage Uses

func (*Timestamp) ProtoMessage()

func (*Timestamp) Reset Uses

func (m *Timestamp) Reset()

func (*Timestamp) String Uses

func (m *Timestamp) String() string

type Type Uses

type Type struct {
    // The fully qualified message name.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
    // The list of fields.
    Fields []*Field `protobuf:"bytes,2,rep,name=fields" json:"fields,omitempty"`
    // The list of oneof definitions.
    Oneofs []string `protobuf:"bytes,3,rep,name=oneofs" json:"oneofs,omitempty"`
    // The proto options.
    Options []*Option `protobuf:"bytes,4,rep,name=options" json:"options,omitempty"`
    // The source context.
    SourceContext *SourceContext `protobuf:"bytes,5,opt,name=source_context" json:"source_context,omitempty"`
    // The source syntax.
    Syntax Syntax `protobuf:"varint,6,opt,name=syntax,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
}

A light-weight descriptor for a proto message type.

func (*Type) Descriptor Uses

func (*Type) Descriptor() ([]byte, []int)

func (*Type) GetFields Uses

func (m *Type) GetFields() []*Field

func (*Type) GetOptions Uses

func (m *Type) GetOptions() []*Option

func (*Type) GetSourceContext Uses

func (m *Type) GetSourceContext() *SourceContext

func (*Type) ProtoMessage Uses

func (*Type) ProtoMessage()

func (*Type) Reset Uses

func (m *Type) Reset()

func (*Type) String Uses

func (m *Type) String() string

type UInt32Value Uses

type UInt32Value struct {
    // The uint32 value.
    Value uint32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
}

Wrapper message for `uint32`.

The JSON representation for `UInt32Value` is JSON number.

func (*UInt32Value) Descriptor Uses

func (*UInt32Value) Descriptor() ([]byte, []int)

func (*UInt32Value) ProtoMessage Uses

func (*UInt32Value) ProtoMessage()

func (*UInt32Value) Reset Uses

func (m *UInt32Value) Reset()

func (*UInt32Value) String Uses

func (m *UInt32Value) String() string

type UInt64Value Uses

type UInt64Value struct {
    // The uint64 value.
    Value uint64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
}

Wrapper message for `uint64`.

The JSON representation for `UInt64Value` is JSON string.

func (*UInt64Value) Descriptor Uses

func (*UInt64Value) Descriptor() ([]byte, []int)

func (*UInt64Value) ProtoMessage Uses

func (*UInt64Value) ProtoMessage()

func (*UInt64Value) Reset Uses

func (m *UInt64Value) Reset()

func (*UInt64Value) String Uses

func (m *UInt64Value) String() string

type Value Uses

type Value struct {
    // The kind of value.
    //
    // Types that are valid to be assigned to Kind:
    //	*Value_NullValue
    //	*Value_NumberValue
    //	*Value_StringValue
    //	*Value_BoolValue
    //	*Value_StructValue
    //	*Value_ListValue
    Kind isValue_Kind `protobuf_oneof:"kind"`
}

`Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of that variants, absence of any variant indicates an error.

The JSON representation for `Value` is JSON value.

func (*Value) Descriptor Uses

func (*Value) Descriptor() ([]byte, []int)

func (*Value) GetBoolValue Uses

func (m *Value) GetBoolValue() bool

func (*Value) GetKind Uses

func (m *Value) GetKind() isValue_Kind

func (*Value) GetListValue Uses

func (m *Value) GetListValue() *ListValue

func (*Value) GetNullValue Uses

func (m *Value) GetNullValue() NullValue

func (*Value) GetNumberValue Uses

func (m *Value) GetNumberValue() float64

func (*Value) GetStringValue Uses

func (m *Value) GetStringValue() string

func (*Value) GetStructValue Uses

func (m *Value) GetStructValue() *Struct

func (*Value) ProtoMessage Uses

func (*Value) ProtoMessage()

func (*Value) Reset Uses

func (m *Value) Reset()

func (*Value) String Uses

func (m *Value) String() string

func (*Value) XXX_OneofFuncs Uses

func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type Value_BoolValue Uses

type Value_BoolValue struct {
    BoolValue bool `protobuf:"varint,4,opt,name=bool_value,oneof"`
}

type Value_ListValue Uses

type Value_ListValue struct {
    ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,oneof"`
}

type Value_NullValue Uses

type Value_NullValue struct {
    NullValue NullValue `protobuf:"varint,1,opt,name=null_value,enum=google.protobuf.NullValue,oneof"`
}

type Value_NumberValue Uses

type Value_NumberValue struct {
    NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,oneof"`
}

type Value_StringValue Uses

type Value_StringValue struct {
    StringValue string `protobuf:"bytes,3,opt,name=string_value,oneof"`
}

type Value_StructValue Uses

type Value_StructValue struct {
    StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,oneof"`
}

Package google_protobuf imports 3 packages (graph) and is imported by 10 packages. Updated 2016-07-19. Refresh now. Tools for package owners.