proto

package
v0.0.0-...-8fa1bb7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

README

The upspin.io/upspin/proto package is generated from the upspin.proto file.

To generate it, you need protoc 3.1.0 or later and the protoc-gen-go tools.

Download the protoc build (version 3.x) for your platform
and put it in your PATH.

	https://github.com/google/protobuf/releases

Use 'go get' to install the latest protoc-gen-go
(git hash 6a1fa94 at time of writing, June 2017):

	$ go get -u github.com/golang/protobuf/protoc-gen-go

Then, run 'go generate' from this directory to re-generate the package:

	$ go generate

If you encounter unexpected diffs, such as changes to the
"ProtoPackageIsVersion3" constants, then you may be using the wrong versions of
protoc or protoc-gen-go.
To debug, run 'which protoc' and 'which protoc-gen-go' and check that the
commands in your path are the ones you just installed.

Documentation

Overview

Package proto contains the protocol buffer definitions shared between RPC servers and clients, mirroring the interfaces and types in the upspin package itself.

These protocol buffers are used in the networking API to talk to Upspin servers. The wire protocol is described by package upspin.io/rpc.

Unlike in some other systems, the protocol buffer types themselves are not used within the rest of the Upspin implementation. Instead, native Go types are used internally and they are converted to the protocol buffer types across the boundary. Helper routines in this package assist in the translation.

Within the protocol buffers, some of the types are stored as uninterpreted bytes that are transcoded with custom code. For instance, the upspin.io/errors.Error type is transmitted as a byte slice that is marshaled and unmarshaled using the MarshalError and UnmarshalError routines in the errors package. This technique preserves the properties of the Go type across the network.

Package proto is a generated protocol buffer package.

It is generated from these files:

upspin.proto

It has these top-level messages:

Endpoint
Location
Refdata
EndpointRequest
EndpointResponse
StoreGetRequest
StoreGetResponse
StorePutRequest
StorePutResponse
StoreDeleteRequest
StoreDeleteResponse
User
KeyLookupRequest
KeyLookupResponse
KeyPutRequest
KeyPutResponse
EntryError
EntriesError
DirLookupRequest
DirPutRequest
DirGlobRequest
DirDeleteRequest
DirWhichAccessRequest
DirWatchRequest
Event

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirEntryBytes

func DirEntryBytes(ude []*upspin.DirEntry) ([][]byte, error)

DirEntryBytes converts from slices of upspin's *DirEntries to bytes.

func PublicKeys

func PublicKeys(upk []upspin.PublicKey) []string

PublicKeys converts from slices of upspin's PublicKey to string.

func UpspinDirEntries

func UpspinDirEntries(b [][]byte) ([]*upspin.DirEntry, error)

UpspinDirEntries converts from slices of bytes to upspin's *DirEntries.

func UpspinDirEntry

func UpspinDirEntry(b []byte) (*upspin.DirEntry, error)

UpspinDirEntry converts a slice of bytes struct to *upspin.DirEntry. If the slice is nil or empty, it returns nil.

func UpspinEndpoints

func UpspinEndpoints(e []*Endpoint) []upspin.Endpoint

UpspinEndpoints converts from slices of proto's Endpoint struct to upspin's.

func UpspinEvent

func UpspinEvent(event *Event) (*upspin.Event, error)

UpspinEvent converts a proto.DirWatchResponse to upspin.Event.

func UpspinLocation

func UpspinLocation(loc *Location) upspin.Location

UpspinLocation converts a proto Location struct to upspin.Location.

func UpspinLocations

func UpspinLocations(l []*Location) []upspin.Location

UpspinLocations converts from slices of proto's Location struct to upspin's.

func UpspinPublicKeys

func UpspinPublicKeys(s []string) []upspin.PublicKey

UpspinPublicKeys converts from slices of strings to upspin's PublicKeys.

func UpspinRefdata

func UpspinRefdata(refdata *Refdata) *upspin.Refdata

UpspinRefdata converts a proto.Refdata to upspin.Refdata.

func UpspinUser

func UpspinUser(user *User) *upspin.User

UpspinUser converts a proto.User to upspin.User.

Types

type DirDeleteRequest

type DirDeleteRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}

func (*DirDeleteRequest) Descriptor

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

func (*DirDeleteRequest) GetName

func (m *DirDeleteRequest) GetName() string

func (*DirDeleteRequest) ProtoMessage

func (*DirDeleteRequest) ProtoMessage()

func (*DirDeleteRequest) Reset

func (m *DirDeleteRequest) Reset()

func (*DirDeleteRequest) String

func (m *DirDeleteRequest) String() string

type DirGlobRequest

type DirGlobRequest struct {
	Pattern string `protobuf:"bytes,1,opt,name=pattern" json:"pattern,omitempty"`
}

func (*DirGlobRequest) Descriptor

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

func (*DirGlobRequest) GetPattern

func (m *DirGlobRequest) GetPattern() string

func (*DirGlobRequest) ProtoMessage

func (*DirGlobRequest) ProtoMessage()

func (*DirGlobRequest) Reset

func (m *DirGlobRequest) Reset()

func (*DirGlobRequest) String

func (m *DirGlobRequest) String() string

type DirLookupRequest

type DirLookupRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}

func (*DirLookupRequest) Descriptor

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

func (*DirLookupRequest) GetName

func (m *DirLookupRequest) GetName() string

func (*DirLookupRequest) ProtoMessage

func (*DirLookupRequest) ProtoMessage()

func (*DirLookupRequest) Reset

func (m *DirLookupRequest) Reset()

func (*DirLookupRequest) String

func (m *DirLookupRequest) String() string

type DirPutRequest

type DirPutRequest struct {
	Entry []byte `protobuf:"bytes,1,opt,name=entry,proto3" json:"entry,omitempty"`
}

func (*DirPutRequest) Descriptor

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

func (*DirPutRequest) GetEntry

func (m *DirPutRequest) GetEntry() []byte

func (*DirPutRequest) ProtoMessage

func (*DirPutRequest) ProtoMessage()

func (*DirPutRequest) Reset

func (m *DirPutRequest) Reset()

func (*DirPutRequest) String

func (m *DirPutRequest) String() string

type DirWatchRequest

type DirWatchRequest struct {
	Name     string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Sequence int64  `protobuf:"varint,2,opt,name=sequence" json:"sequence,omitempty"`
}

func (*DirWatchRequest) Descriptor

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

func (*DirWatchRequest) GetName

func (m *DirWatchRequest) GetName() string

func (*DirWatchRequest) GetSequence

func (m *DirWatchRequest) GetSequence() int64

func (*DirWatchRequest) ProtoMessage

func (*DirWatchRequest) ProtoMessage()

func (*DirWatchRequest) Reset

func (m *DirWatchRequest) Reset()

func (*DirWatchRequest) String

func (m *DirWatchRequest) String() string

type DirWhichAccessRequest

type DirWhichAccessRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}

func (*DirWhichAccessRequest) Descriptor

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

func (*DirWhichAccessRequest) GetName

func (m *DirWhichAccessRequest) GetName() string

func (*DirWhichAccessRequest) ProtoMessage

func (*DirWhichAccessRequest) ProtoMessage()

func (*DirWhichAccessRequest) Reset

func (m *DirWhichAccessRequest) Reset()

func (*DirWhichAccessRequest) String

func (m *DirWhichAccessRequest) String() string

type Endpoint

type Endpoint struct {
	Transport int32  `protobuf:"varint,1,opt,name=transport" json:"transport,omitempty"`
	NetAddr   string `protobuf:"bytes,2,opt,name=net_addr,json=netAddr" json:"net_addr,omitempty"`
}

Endpoint mirrors upspin.Endpoint.

func Endpoints

func Endpoints(ue []upspin.Endpoint) []*Endpoint

Endpoints converts from slices of upspin's Endpoint struct to proto's.

func (*Endpoint) Descriptor

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

func (*Endpoint) GetNetAddr

func (m *Endpoint) GetNetAddr() string

func (*Endpoint) GetTransport

func (m *Endpoint) GetTransport() int32

func (*Endpoint) ProtoMessage

func (*Endpoint) ProtoMessage()

func (*Endpoint) Reset

func (m *Endpoint) Reset()

func (*Endpoint) String

func (m *Endpoint) String() string

type EndpointRequest

type EndpointRequest struct {
}

func (*EndpointRequest) Descriptor

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

func (*EndpointRequest) ProtoMessage

func (*EndpointRequest) ProtoMessage()

func (*EndpointRequest) Reset

func (m *EndpointRequest) Reset()

func (*EndpointRequest) String

func (m *EndpointRequest) String() string

type EndpointResponse

type EndpointResponse struct {
	Endpoint *Endpoint `protobuf:"bytes,1,opt,name=endpoint" json:"endpoint,omitempty"`
}

func (*EndpointResponse) Descriptor

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

func (*EndpointResponse) GetEndpoint

func (m *EndpointResponse) GetEndpoint() *Endpoint

func (*EndpointResponse) ProtoMessage

func (*EndpointResponse) ProtoMessage()

func (*EndpointResponse) Reset

func (m *EndpointResponse) Reset()

func (*EndpointResponse) String

func (m *EndpointResponse) String() string

type EntriesError

type EntriesError struct {
	Entries [][]byte `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
	Error   []byte   `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
}

func (*EntriesError) Descriptor

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

func (*EntriesError) GetEntries

func (m *EntriesError) GetEntries() [][]byte

func (*EntriesError) GetError

func (m *EntriesError) GetError() []byte

func (*EntriesError) ProtoMessage

func (*EntriesError) ProtoMessage()

func (*EntriesError) Reset

func (m *EntriesError) Reset()

func (*EntriesError) String

func (m *EntriesError) String() string

type EntryError

type EntryError struct {
	Entry []byte `protobuf:"bytes,1,opt,name=entry,proto3" json:"entry,omitempty"`
	Error []byte `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
}

func (*EntryError) Descriptor

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

func (*EntryError) GetEntry

func (m *EntryError) GetEntry() []byte

func (*EntryError) GetError

func (m *EntryError) GetError() []byte

func (*EntryError) ProtoMessage

func (*EntryError) ProtoMessage()

func (*EntryError) Reset

func (m *EntryError) Reset()

func (*EntryError) String

func (m *EntryError) String() string

type Event

type Event struct {
	Entry    []byte `protobuf:"bytes,1,opt,name=entry,proto3" json:"entry,omitempty"`
	Sequence int64  `protobuf:"varint,2,opt,name=sequence" json:"sequence,omitempty"`
	Delete   bool   `protobuf:"varint,3,opt,name=delete" json:"delete,omitempty"`
	Error    []byte `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
}

The first response in the stream is whether dir.Watch succeeded. If it didn't, the error field contains the error and no streaming happens. If it did succeed the error is nil and subsequent streams are from the Events channel.

func EventProto

func EventProto(event *upspin.Event) (*Event, error)

EventProto converts an upspin.Event to proto.Event.

func (*Event) Descriptor

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

func (*Event) GetDelete

func (m *Event) GetDelete() bool

func (*Event) GetEntry

func (m *Event) GetEntry() []byte

func (*Event) GetError

func (m *Event) GetError() []byte

func (*Event) GetSequence

func (m *Event) GetSequence() int64

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) String

func (m *Event) String() string

type KeyLookupRequest

type KeyLookupRequest struct {
	UserName string `protobuf:"bytes,1,opt,name=user_name,json=userName" json:"user_name,omitempty"`
}

func (*KeyLookupRequest) Descriptor

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

func (*KeyLookupRequest) GetUserName

func (m *KeyLookupRequest) GetUserName() string

func (*KeyLookupRequest) ProtoMessage

func (*KeyLookupRequest) ProtoMessage()

func (*KeyLookupRequest) Reset

func (m *KeyLookupRequest) Reset()

func (*KeyLookupRequest) String

func (m *KeyLookupRequest) String() string

type KeyLookupResponse

type KeyLookupResponse struct {
	User  *User  `protobuf:"bytes,1,opt,name=user" json:"user,omitempty"`
	Error []byte `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
}

func (*KeyLookupResponse) Descriptor

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

func (*KeyLookupResponse) GetError

func (m *KeyLookupResponse) GetError() []byte

func (*KeyLookupResponse) GetUser

func (m *KeyLookupResponse) GetUser() *User

func (*KeyLookupResponse) ProtoMessage

func (*KeyLookupResponse) ProtoMessage()

func (*KeyLookupResponse) Reset

func (m *KeyLookupResponse) Reset()

func (*KeyLookupResponse) String

func (m *KeyLookupResponse) String() string

type KeyPutRequest

type KeyPutRequest struct {
	User *User `protobuf:"bytes,1,opt,name=user" json:"user,omitempty"`
}

func (*KeyPutRequest) Descriptor

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

func (*KeyPutRequest) GetUser

func (m *KeyPutRequest) GetUser() *User

func (*KeyPutRequest) ProtoMessage

func (*KeyPutRequest) ProtoMessage()

func (*KeyPutRequest) Reset

func (m *KeyPutRequest) Reset()

func (*KeyPutRequest) String

func (m *KeyPutRequest) String() string

type KeyPutResponse

type KeyPutResponse struct {
	Error []byte `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
}

func (*KeyPutResponse) Descriptor

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

func (*KeyPutResponse) GetError

func (m *KeyPutResponse) GetError() []byte

func (*KeyPutResponse) ProtoMessage

func (*KeyPutResponse) ProtoMessage()

func (*KeyPutResponse) Reset

func (m *KeyPutResponse) Reset()

func (*KeyPutResponse) String

func (m *KeyPutResponse) String() string

type Location

type Location struct {
	Endpoint  *Endpoint `protobuf:"bytes,1,opt,name=endpoint" json:"endpoint,omitempty"`
	Reference string    `protobuf:"bytes,2,opt,name=reference" json:"reference,omitempty"`
}

Location mirrors upspin.Location.

func Locations

func Locations(ul []upspin.Location) []*Location

Locations converts from slices of upspin's Location struct to proto's.

func (*Location) Descriptor

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

func (*Location) GetEndpoint

func (m *Location) GetEndpoint() *Endpoint

func (*Location) GetReference

func (m *Location) GetReference() string

func (*Location) ProtoMessage

func (*Location) ProtoMessage()

func (*Location) Reset

func (m *Location) Reset()

func (*Location) String

func (m *Location) String() string

type Refdata

type Refdata struct {
	Reference string `protobuf:"bytes,1,opt,name=reference" json:"reference,omitempty"`
	Volatile  bool   `protobuf:"varint,2,opt,name=volatile" json:"volatile,omitempty"`
	Duration  int64  `protobuf:"varint,3,opt,name=duration" json:"duration,omitempty"`
}

Refdata mirrors upspin.Refdata.

func RefdataProto

func RefdataProto(refdata *upspin.Refdata) *Refdata

RefdataProto converts an upspin.Refdata to a proto.Refdata.

func (*Refdata) Descriptor

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

func (*Refdata) GetDuration

func (m *Refdata) GetDuration() int64

func (*Refdata) GetReference

func (m *Refdata) GetReference() string

func (*Refdata) GetVolatile

func (m *Refdata) GetVolatile() bool

func (*Refdata) ProtoMessage

func (*Refdata) ProtoMessage()

func (*Refdata) Reset

func (m *Refdata) Reset()

func (*Refdata) String

func (m *Refdata) String() string

type StoreDeleteRequest

type StoreDeleteRequest struct {
	Reference string `protobuf:"bytes,1,opt,name=reference" json:"reference,omitempty"`
}

func (*StoreDeleteRequest) Descriptor

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

func (*StoreDeleteRequest) GetReference

func (m *StoreDeleteRequest) GetReference() string

func (*StoreDeleteRequest) ProtoMessage

func (*StoreDeleteRequest) ProtoMessage()

func (*StoreDeleteRequest) Reset

func (m *StoreDeleteRequest) Reset()

func (*StoreDeleteRequest) String

func (m *StoreDeleteRequest) String() string

type StoreDeleteResponse

type StoreDeleteResponse struct {
	Error []byte `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
}

func (*StoreDeleteResponse) Descriptor

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

func (*StoreDeleteResponse) GetError

func (m *StoreDeleteResponse) GetError() []byte

func (*StoreDeleteResponse) ProtoMessage

func (*StoreDeleteResponse) ProtoMessage()

func (*StoreDeleteResponse) Reset

func (m *StoreDeleteResponse) Reset()

func (*StoreDeleteResponse) String

func (m *StoreDeleteResponse) String() string

type StoreGetRequest

type StoreGetRequest struct {
	Reference string `protobuf:"bytes,1,opt,name=reference" json:"reference,omitempty"`
}

func (*StoreGetRequest) Descriptor

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

func (*StoreGetRequest) GetReference

func (m *StoreGetRequest) GetReference() string

func (*StoreGetRequest) ProtoMessage

func (*StoreGetRequest) ProtoMessage()

func (*StoreGetRequest) Reset

func (m *StoreGetRequest) Reset()

func (*StoreGetRequest) String

func (m *StoreGetRequest) String() string

type StoreGetResponse

type StoreGetResponse struct {
	Data      []byte      `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Refdata   *Refdata    `protobuf:"bytes,2,opt,name=refdata" json:"refdata,omitempty"`
	Locations []*Location `protobuf:"bytes,3,rep,name=locations" json:"locations,omitempty"`
	Error     []byte      `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
}

func (*StoreGetResponse) Descriptor

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

func (*StoreGetResponse) GetData

func (m *StoreGetResponse) GetData() []byte

func (*StoreGetResponse) GetError

func (m *StoreGetResponse) GetError() []byte

func (*StoreGetResponse) GetLocations

func (m *StoreGetResponse) GetLocations() []*Location

func (*StoreGetResponse) GetRefdata

func (m *StoreGetResponse) GetRefdata() *Refdata

func (*StoreGetResponse) ProtoMessage

func (*StoreGetResponse) ProtoMessage()

func (*StoreGetResponse) Reset

func (m *StoreGetResponse) Reset()

func (*StoreGetResponse) String

func (m *StoreGetResponse) String() string

type StorePutRequest

type StorePutRequest struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

func (*StorePutRequest) Descriptor

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

func (*StorePutRequest) GetData

func (m *StorePutRequest) GetData() []byte

func (*StorePutRequest) ProtoMessage

func (*StorePutRequest) ProtoMessage()

func (*StorePutRequest) Reset

func (m *StorePutRequest) Reset()

func (*StorePutRequest) String

func (m *StorePutRequest) String() string

type StorePutResponse

type StorePutResponse struct {
	Refdata *Refdata `protobuf:"bytes,1,opt,name=refdata" json:"refdata,omitempty"`
	Error   []byte   `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
}

func (*StorePutResponse) Descriptor

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

func (*StorePutResponse) GetError

func (m *StorePutResponse) GetError() []byte

func (*StorePutResponse) GetRefdata

func (m *StorePutResponse) GetRefdata() *Refdata

func (*StorePutResponse) ProtoMessage

func (*StorePutResponse) ProtoMessage()

func (*StorePutResponse) Reset

func (m *StorePutResponse) Reset()

func (*StorePutResponse) String

func (m *StorePutResponse) String() string

type User

type User struct {
	Name      string      `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Dirs      []*Endpoint `protobuf:"bytes,2,rep,name=dirs" json:"dirs,omitempty"`
	Stores    []*Endpoint `protobuf:"bytes,3,rep,name=stores" json:"stores,omitempty"`
	PublicKey string      `protobuf:"bytes,4,opt,name=public_key,json=publicKey" json:"public_key,omitempty"`
}

func UserProto

func UserProto(user *upspin.User) *User

UserProto converts an upspin.User to a proto.User.

func (*User) Descriptor

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

func (*User) GetDirs

func (m *User) GetDirs() []*Endpoint

func (*User) GetName

func (m *User) GetName() string

func (*User) GetPublicKey

func (m *User) GetPublicKey() string

func (*User) GetStores

func (m *User) GetStores() []*Endpoint

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

Jump to

Keyboard shortcuts

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