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 ¶
- func DirEntryBytes(ude []*upspin.DirEntry) ([][]byte, error)
- func PublicKeys(upk []upspin.PublicKey) []string
- func UpspinDirEntries(b [][]byte) ([]*upspin.DirEntry, error)
- func UpspinDirEntry(b []byte) (*upspin.DirEntry, error)
- func UpspinEndpoints(e []*Endpoint) []upspin.Endpoint
- func UpspinEvent(event *Event) (*upspin.Event, error)
- func UpspinLocation(loc *Location) upspin.Location
- func UpspinLocations(l []*Location) []upspin.Location
- func UpspinPublicKeys(s []string) []upspin.PublicKey
- func UpspinRefdata(refdata *Refdata) *upspin.Refdata
- func UpspinUser(user *User) *upspin.User
- type DirDeleteRequest
- type DirGlobRequest
- type DirLookupRequest
- type DirPutRequest
- type DirWatchRequest
- type DirWhichAccessRequest
- type Endpoint
- type EndpointRequest
- type EndpointResponse
- type EntriesError
- type EntryError
- type Event
- type KeyLookupRequest
- type KeyLookupResponse
- type KeyPutRequest
- type KeyPutResponse
- type Location
- type Refdata
- type StoreDeleteRequest
- type StoreDeleteResponse
- type StoreGetRequest
- type StoreGetResponse
- func (*StoreGetResponse) Descriptor() ([]byte, []int)
- func (m *StoreGetResponse) GetData() []byte
- func (m *StoreGetResponse) GetError() []byte
- func (m *StoreGetResponse) GetLocations() []*Location
- func (m *StoreGetResponse) GetRefdata() *Refdata
- func (*StoreGetResponse) ProtoMessage()
- func (m *StoreGetResponse) Reset()
- func (m *StoreGetResponse) String() string
- type StorePutRequest
- type StorePutResponse
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirEntryBytes ¶
DirEntryBytes converts from slices of upspin's *DirEntries to bytes.
func PublicKeys ¶
PublicKeys converts from slices of upspin's PublicKey to string.
func UpspinDirEntries ¶
UpspinDirEntries converts from slices of bytes to upspin's *DirEntries.
func UpspinDirEntry ¶
UpspinDirEntry converts a slice of bytes struct to *upspin.DirEntry. If the slice is nil or empty, it returns nil.
func UpspinEndpoints ¶
UpspinEndpoints converts from slices of proto's Endpoint struct to upspin's.
func UpspinEvent ¶
UpspinEvent converts a proto.DirWatchResponse to upspin.Event.
func UpspinLocation ¶
UpspinLocation converts a proto Location struct to upspin.Location.
func UpspinLocations ¶
UpspinLocations converts from slices of proto's Location struct to upspin's.
func UpspinPublicKeys ¶
UpspinPublicKeys converts from slices of strings to upspin's PublicKeys.
func UpspinRefdata ¶
UpspinRefdata converts a proto.Refdata to upspin.Refdata.
func UpspinUser ¶
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 (*Endpoint) Descriptor ¶
func (*Endpoint) GetNetAddr ¶
func (*Endpoint) GetTransport ¶
func (*Endpoint) ProtoMessage ¶
func (*Endpoint) ProtoMessage()
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 ¶
EventProto converts an upspin.Event to proto.Event.
func (*Event) Descriptor ¶
func (*Event) GetSequence ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
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 (*Location) Descriptor ¶
func (*Location) GetEndpoint ¶
func (*Location) GetReference ¶
func (*Location) ProtoMessage ¶
func (*Location) ProtoMessage()
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 ¶
RefdataProto converts an upspin.Refdata to a proto.Refdata.
func (*Refdata) Descriptor ¶
func (*Refdata) GetDuration ¶
func (*Refdata) GetReference ¶
func (*Refdata) GetVolatile ¶
func (*Refdata) ProtoMessage ¶
func (*Refdata) ProtoMessage()
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 (*User) Descriptor ¶
func (*User) GetPublicKey ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()