luci: go.chromium.org/luci/common/proto/examples Index | Files

package examples

import "go.chromium.org/luci/common/proto/examples"

Package examples shows how to design protos which adhere to the Google Cloud API design guide.

https://cloud.google.com/apis/design/

Index

Package Files

doc.go examples.pb.go generate.go

type ListRequest Uses

type ListRequest struct {
    // The value of next_page_token received in a ListResponse. Used to get the
    // next page of records. If empty, gets the first page.
    PageToken string `protobuf:"bytes,1,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
    // The maximum number of results to include in the response.
    PageSize             int32    `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

An example request to list existing records. Demonstrates usage of standard fields.

https://cloud.google.com/apis/design/standard_fields

func (*ListRequest) Descriptor Uses

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

func (*ListRequest) GetPageSize Uses

func (m *ListRequest) GetPageSize() int32

func (*ListRequest) GetPageToken Uses

func (m *ListRequest) GetPageToken() string

func (*ListRequest) ProtoMessage Uses

func (*ListRequest) ProtoMessage()

func (*ListRequest) Reset Uses

func (m *ListRequest) Reset()

func (*ListRequest) String Uses

func (m *ListRequest) String() string

func (*ListRequest) XXX_DiscardUnknown Uses

func (m *ListRequest) XXX_DiscardUnknown()

func (*ListRequest) XXX_Marshal Uses

func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListRequest) XXX_Merge Uses

func (m *ListRequest) XXX_Merge(src proto.Message)

func (*ListRequest) XXX_Size Uses

func (m *ListRequest) XXX_Size() int

func (*ListRequest) XXX_Unmarshal Uses

func (m *ListRequest) XXX_Unmarshal(b []byte) error

type ListResponse Uses

type ListResponse struct {
    // The record.
    Records []string `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
    // The value to use as the page_token in a ListRequest to get the next page of
    // records. If empty, there are no more records.
    NextPageToken        string   `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

An example response to a request to list records. Demonstrates usage of standard fields.

https://cloud.google.com/apis/design/standard_fields

func (*ListResponse) Descriptor Uses

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

func (*ListResponse) GetNextPageToken Uses

func (m *ListResponse) GetNextPageToken() string

func (*ListResponse) GetRecords Uses

func (m *ListResponse) GetRecords() []string

func (*ListResponse) ProtoMessage Uses

func (*ListResponse) ProtoMessage()

func (*ListResponse) Reset Uses

func (m *ListResponse) Reset()

func (*ListResponse) String Uses

func (m *ListResponse) String() string

func (*ListResponse) XXX_DiscardUnknown Uses

func (m *ListResponse) XXX_DiscardUnknown()

func (*ListResponse) XXX_Marshal Uses

func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListResponse) XXX_Merge Uses

func (m *ListResponse) XXX_Merge(src proto.Message)

func (*ListResponse) XXX_Size Uses

func (m *ListResponse) XXX_Size() int

func (*ListResponse) XXX_Unmarshal Uses

func (m *ListResponse) XXX_Unmarshal(b []byte) error

Package examples imports 3 packages (graph). Updated 2019-11-15. Refresh now. Tools for package owners.