Documentation
¶
Index ¶
- Constants
- Variables
- func NormalizeKeypath(keypath string) (string, error)
- func PathIsShallow(path []byte, mustHaveParent []byte) bool
- func RegisterRepoGrpcServer(s *grpc.Server, srv RepoGrpcServer)
- func SplitPath(path []byte) (dir, file []byte)
- type ChKey
- type ChReq
- func (*ChReq) Descriptor() ([]byte, []int)
- func (m *ChReq) GetChStateURI() *ChStateURI
- func (m *ChReq) GetChURI() string
- func (m *ChReq) GetGetOp() *GetOp
- func (m *ChReq) GetReqID() int32
- func (m *ChReq) GetReqOp() ChReqOp
- func (m *ChReq) GetTxOp() *TxOp
- func (m *ChReq) Marshal() (dAtA []byte, err error)
- func (m *ChReq) MarshalTo(dAtA []byte) (int, error)
- func (m *ChReq) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ChReq) ProtoMessage()
- func (m *ChReq) Reset()
- func (m *ChReq) Size() (n int)
- func (m *ChReq) String() string
- func (m *ChReq) Unmarshal(dAtA []byte) error
- func (m *ChReq) XXX_DiscardUnknown()
- func (m *ChReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ChReq) XXX_Merge(src proto.Message)
- func (m *ChReq) XXX_Size() int
- func (m *ChReq) XXX_Unmarshal(b []byte) error
- type ChReqOp
- type ChStateURI
- func (uri *ChStateURI) AssignFromURI(uriStr string) error
- func (*ChStateURI) Descriptor() ([]byte, []int)
- func (uri *ChStateURI) FormChURI() (string, error)
- func (m *ChStateURI) GetChID() string
- func (m *ChStateURI) GetChID_TID() []byte
- func (m *ChStateURI) GetDomainName() string
- func (m *ChStateURI) GetStateURI() string
- func (m *ChStateURI) Marshal() (dAtA []byte, err error)
- func (m *ChStateURI) MarshalTo(dAtA []byte) (int, error)
- func (m *ChStateURI) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ChStateURI) ProtoMessage()
- func (m *ChStateURI) Reset()
- func (m *ChStateURI) Size() (n int)
- func (m *ChStateURI) String() string
- func (m *ChStateURI) Unmarshal(dAtA []byte) error
- func (m *ChStateURI) XXX_DiscardUnknown()
- func (m *ChStateURI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ChStateURI) XXX_Merge(src proto.Message)
- func (m *ChStateURI) XXX_Size() int
- func (m *ChStateURI) XXX_Unmarshal(b []byte) error
- type ChSub
- type Const
- type Domain
- type EnclaveAccess
- func (*EnclaveAccess) Descriptor() ([]byte, []int)
- func (m *EnclaveAccess) GetKeypath() string
- func (m *EnclaveAccess) GetPasshash() []byte
- func (m *EnclaveAccess) Marshal() (dAtA []byte, err error)
- func (m *EnclaveAccess) MarshalTo(dAtA []byte) (int, error)
- func (m *EnclaveAccess) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EnclaveAccess) ProtoMessage()
- func (m *EnclaveAccess) Reset()
- func (m *EnclaveAccess) Size() (n int)
- func (m *EnclaveAccess) String() string
- func (m *EnclaveAccess) Unmarshal(dAtA []byte) error
- func (m *EnclaveAccess) XXX_DiscardUnknown()
- func (m *EnclaveAccess) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EnclaveAccess) XXX_Merge(src proto.Message)
- func (m *EnclaveAccess) XXX_Size() int
- func (m *EnclaveAccess) XXX_Unmarshal(b []byte) error
- type ErrCode
- type GetOp
- func (*GetOp) Descriptor() ([]byte, []int)
- func (m *GetOp) GetKeypath() string
- func (m *GetOp) GetMaintainSync() bool
- func (m *GetOp) GetScope() KeypathScope
- func (m *GetOp) Marshal() (dAtA []byte, err error)
- func (m *GetOp) MarshalTo(dAtA []byte) (int, error)
- func (m *GetOp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetOp) ProtoMessage()
- func (m *GetOp) Reset()
- func (m *GetOp) Size() (n int)
- func (m *GetOp) String() string
- func (m *GetOp) Unmarshal(dAtA []byte) error
- func (m *GetOp) XXX_DiscardUnknown()
- func (m *GetOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetOp) XXX_Merge(src proto.Message)
- func (m *GetOp) XXX_Size() int
- func (m *GetOp) XXX_Unmarshal(b []byte) error
- type GrpcServer
- type Host
- type HostParams
- type KeypathScope
- type LID
- type MemberSession
- type Node
- func (*Node) Descriptor() ([]byte, []int)
- func (m *Node) GetAssetURI() string
- func (m *Node) GetAttachment() []byte
- func (m *Node) GetGlyphURI() string
- func (m *Node) GetInt() int64
- func (m *Node) GetKeypath() string
- func (m *Node) GetOp() NodeOp
- func (m *Node) GetParentRevID() int64
- func (m *Node) GetReqID() int32
- func (m *Node) GetRevID() int64
- func (m *Node) GetRotate1() float32
- func (m *Node) GetRotate2() float32
- func (m *Node) GetRotate3() float32
- func (m *Node) GetScale1() float32
- func (m *Node) GetScale2() float32
- func (m *Node) GetScale3() float32
- func (m *Node) GetScaleMode() NodeScaleMode
- func (m *Node) GetStr() string
- func (m *Node) GetText() string
- func (m *Node) GetTextFormat() TextFormat
- func (m *Node) GetTypeID() string
- func (m *Node) GetX1() float64
- func (m *Node) GetX2() float64
- func (m *Node) GetX3() float64
- func (m *Node) Marshal() (dAtA []byte, err error)
- func (m *Node) MarshalTo(dAtA []byte) (int, error)
- func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Node) ProtoMessage()
- func (m *Node) Reset()
- func (m *Node) Size() (n int)
- func (m *Node) String() string
- func (m *Node) Unmarshal(dAtA []byte) error
- func (m *Node) XXX_DiscardUnknown()
- func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Node) XXX_Merge(src proto.Message)
- func (m *Node) XXX_Size() int
- func (m *Node) XXX_Unmarshal(b []byte) error
- type NodeOp
- type NodeScaleMode
- type RawTx
- func (*RawTx) Descriptor() ([]byte, []int)
- func (m *RawTx) GetBody() []byte
- func (m *RawTx) GetHeader() []byte
- func (m *RawTx) GetTID() []byte
- func (m *RawTx) GetTxnStatus() TxnStatus
- func (m *RawTx) Marshal() (dAtA []byte, err error)
- func (m *RawTx) MarshalTo(dAtA []byte) (int, error)
- func (m *RawTx) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RawTx) ProtoMessage()
- func (m *RawTx) Reset()
- func (m *RawTx) Size() (n int)
- func (m *RawTx) String() string
- func (m *RawTx) Unmarshal(dAtA []byte) error
- func (m *RawTx) XXX_DiscardUnknown()
- func (m *RawTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RawTx) XXX_Merge(src proto.Message)
- func (m *RawTx) XXX_Size() int
- func (m *RawTx) XXX_Unmarshal(b []byte) error
- type RepoGrpcClient
- type RepoGrpcServer
- type RepoGrpc_RepoServiceSessionClient
- type RepoGrpc_RepoServiceSessionServer
- type ReqErr
- func (*ReqErr) Descriptor() ([]byte, []int)
- func (err *ReqErr) Error() string
- func (m *ReqErr) GetCode() ErrCode
- func (m *ReqErr) GetMsg() string
- func (m *ReqErr) Marshal() (dAtA []byte, err error)
- func (m *ReqErr) MarshalTo(dAtA []byte) (int, error)
- func (m *ReqErr) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ReqErr) ProtoMessage()
- func (m *ReqErr) Reset()
- func (m *ReqErr) Size() (n int)
- func (m *ReqErr) String() string
- func (m *ReqErr) Unmarshal(dAtA []byte) error
- func (m *ReqErr) XXX_DiscardUnknown()
- func (m *ReqErr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ReqErr) XXX_Merge(src proto.Message)
- func (m *ReqErr) XXX_Size() int
- func (m *ReqErr) XXX_Unmarshal(b []byte) error
- type ResolveMode
- type TID
- func (tid TID) Base32() string
- func (tid TID) Buf() TIDBuf
- func (tid TID) Clone() TID
- func (tid TID) CopyNext(inTID TID)
- func (tid TID) ExtractTime() int64
- func (tid TID) ExtractTimeFS() device.TimeFS
- func (tid TID) IsNil() bool
- func (tid TID) SelectEarlier(t device.TimeFS) bool
- func (tid TID) SetHash(hash []byte)
- func (tid TID) SetTimeAndHash(time device.TimeFS, hash []byte)
- func (tid TID) SetTimeFS(t device.TimeFS)
- func (tid TID) SuffixStr() string
- type TIDBuf
- type TextFormat
- type Tx
- func (*Tx) Descriptor() ([]byte, []int)
- func (m *Tx) GetHash() []byte
- func (m *Tx) GetTID() []byte
- func (m *Tx) GetTxOp() *TxOp
- func (m *Tx) Marshal() (dAtA []byte, err error)
- func (m *Tx) MarshalTo(dAtA []byte) (int, error)
- func (m *Tx) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Tx) ProtoMessage()
- func (m *Tx) Reset()
- func (m *Tx) Size() (n int)
- func (m *Tx) String() string
- func (m *Tx) Unmarshal(dAtA []byte) error
- func (m *Tx) XXX_DiscardUnknown()
- func (m *Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Tx) XXX_Merge(src proto.Message)
- func (m *Tx) XXX_Size() int
- func (m *Tx) XXX_Unmarshal(b []byte) error
- type TxOp
- func (*TxOp) Descriptor() ([]byte, []int)
- func (m *TxOp) GetChStateURI() *ChStateURI
- func (m *TxOp) GetChannelGenesis() bool
- func (m *TxOp) GetEntries() []*Node
- func (m *TxOp) Marshal() (dAtA []byte, err error)
- func (m *TxOp) MarshalTo(dAtA []byte) (int, error)
- func (m *TxOp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TxOp) ProtoMessage()
- func (m *TxOp) Reset()
- func (m *TxOp) Size() (n int)
- func (m *TxOp) String() string
- func (m *TxOp) Unmarshal(dAtA []byte) error
- func (m *TxOp) XXX_DiscardUnknown()
- func (m *TxOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TxOp) XXX_Merge(src proto.Message)
- func (m *TxOp) XXX_Size() int
- func (m *TxOp) XXX_Unmarshal(b []byte) error
- type TxnStatus
- type UnimplementedRepoGrpcServer
Constants ¶
const TIDEncodedLen = int(Const_TIDEncodedLen)
TIDEncodedLen is the ASCII-compatible string length of a (binary) TID encoded into its base32 form.
const TIDSz = int(Const_TIDSz)
TIDSz is the byte size of a TID, a hash with a leading embedded big endian binary time index.
Variables ¶
var ( ErrInvalidLengthRepo = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRepo = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupRepo = fmt.Errorf("proto: unexpected end of group") )
var ChReqOp_name = map[int32]string{
0: "Auto",
1: "CancelReq",
2: "AccessGrant",
}
var ChReqOp_value = map[string]int32{
"Auto": 0,
"CancelReq": 1,
"AccessGrant": 2,
}
var Const_name = map[int32]string{
0: "ConstDefs",
30: "TIDSz",
48: "TIDEncodedLen",
8: "TIDTimestampSz",
5192: "DefaultGrpcServicePort",
}
var Const_value = map[string]int32{
"ConstDefs": 0,
"TIDSz": 30,
"TIDEncodedLen": 48,
"TIDTimestampSz": 8,
"DefaultGrpcServicePort": 5192,
}
var ErrCode_name = map[int32]string{
0: "NoErr",
5000: "UnnamedErr",
5001: "InternalErr",
5002: "UnsupporteReqOp",
5003: "ReqCanceled",
5004: "ShuttingDown",
5005: "Disconnected",
5010: "ReqIDNotFound",
5020: "InvalidKeypath",
5021: "InvalidURI",
5022: "FailedToOpenChURI",
5030: "NothingToCommit",
5031: "CommitFailed",
5032: "DomainNotFound",
5040: "CorruptChEntry",
5100: "ViolatesAppendOnly",
5101: "InsufficientPermissions",
5201: "ChProtocolNotRecognized",
}
var ErrCode_value = map[string]int32{
"NoErr": 0,
"UnnamedErr": 5000,
"InternalErr": 5001,
"UnsupporteReqOp": 5002,
"ReqCanceled": 5003,
"ShuttingDown": 5004,
"Disconnected": 5005,
"ReqIDNotFound": 5010,
"InvalidKeypath": 5020,
"InvalidURI": 5021,
"FailedToOpenChURI": 5022,
"NothingToCommit": 5030,
"CommitFailed": 5031,
"DomainNotFound": 5032,
"CorruptChEntry": 5040,
"ViolatesAppendOnly": 5100,
"InsufficientPermissions": 5101,
"ChProtocolNotRecognized": 5201,
}
var KeypathScope_name = map[int32]string{
0: "NoScope",
1: "EntryAtKeypath",
2: "Shallow",
4: "ShallowAndDeep",
}
var KeypathScope_value = map[string]int32{
"NoScope": 0,
"EntryAtKeypath": 1,
"Shallow": 2,
"ShallowAndDeep": 4,
}
var NodeOp_name = map[int32]string{
0: "NodeUpdate",
2: "NodeRemove",
3: "NodeRemoveAll",
10: "ReqComplete",
11: "ReqDiscarded",
20: "ChSyncSuspend",
21: "ChSyncResume",
}
var NodeOp_value = map[string]int32{
"NodeUpdate": 0,
"NodeRemove": 2,
"NodeRemoveAll": 3,
"ReqComplete": 10,
"ReqDiscarded": 11,
"ChSyncSuspend": 20,
"ChSyncResume": 21,
}
var NodeScaleMode_name = map[int32]string{
0: "AutoScale",
1: "FixedScale",
}
var NodeScaleMode_value = map[string]int32{
"AutoScale": 0,
"FixedScale": 1,
}
var ResolveMode_name = map[int32]string{
0: "Raw",
1: "ResolveByTime",
2: "ResolveByMemberRank",
3: "ResolveByGrantRank",
}
var ResolveMode_value = map[string]int32{
"Raw": 0,
"ResolveByTime": 1,
"ResolveByMemberRank": 2,
"ResolveByGrantRank": 3,
}
var TextFormat_name = map[int32]string{
0: "PlainText",
1: "RTF",
2: "HTML",
}
var TextFormat_value = map[string]int32{
"PlainText": 0,
"RTF": 1,
"HTML": 2,
}
var TxnStatus_name = map[int32]string{
0: "New",
}
var TxnStatus_value = map[string]int32{
"New": 0,
}
Functions ¶
func NormalizeKeypath ¶
NormalizeKeypath checks that there are no problems with the given keypath string and returns a standardized Keypath.
This means removing a leading and trailing '/' (if present)
func PathIsShallow ¶
PathIsShallow returns true if the item path's parent is the given parent path
func RegisterRepoGrpcServer ¶
func RegisterRepoGrpcServer(s *grpc.Server, srv RepoGrpcServer)
Types ¶
type ChReq ¶
type ChReq struct {
// ReqOp requests that the given op to be execute on ChReq.Entries
ReqOp ChReqOp `protobuf:"varint,1,opt,name=ReqOp,proto3,enum=repo.ChReqOp" json:"ReqOp,omitempty"`
// ReqID is a client-assigned ID that allows the client and server to reference this ChReq in the future.
// Node.ReqComplete & ReqDiscarded is how the server signals when this request is considered closed/complete.
ReqID int32 `protobuf:"varint,2,opt,name=ReqID,proto3" json:"ReqID,omitempty"`
// ChURI identifies the channel URI that this ChReq is requesting to access.
// Channel URIs take the form of "<DomainName>[/<ChID>]".
ChURI string `protobuf:"bytes,3,opt,name=ChURI,proto3" json:"ChURI,omitempty"`
// ChStateURI expresses the channel URI that this op applies to.
// If not set, it will be auto-assigned by parsing ChReq.ChURI.
ChStateURI *ChStateURI `protobuf:"bytes,4,opt,name=ChStateURI,proto3" json:"ChStateURI,omitempty"`
// When ReqOp == ChReqOp.Auto, one of these ops is to be executed.
// It's an error to set more than one of these.
GetOp *GetOp `protobuf:"bytes,10,opt,name=GetOp,proto3" json:"GetOp,omitempty"`
TxOp *TxOp `protobuf:"bytes,11,opt,name=TxOp,proto3" json:"TxOp,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
ChReq is generalized request sent from client to server via ServeChannel(). The client sends a stream of ChReqs and monitors the Nodes that a server sends back to monitor status and completion.
func (*ChReq) Descriptor ¶
func (*ChReq) GetChStateURI ¶
func (m *ChReq) GetChStateURI() *ChStateURI
func (*ChReq) ProtoMessage ¶
func (*ChReq) ProtoMessage()
func (*ChReq) XXX_DiscardUnknown ¶
func (m *ChReq) XXX_DiscardUnknown()
func (*ChReq) XXX_Marshal ¶
func (*ChReq) XXX_Unmarshal ¶
type ChReqOp ¶
type ChReqOp int32
ChReqOp is a code describing the purpose and format of the ChReq that it resides in.
const ( // Auto means to see if ChReq.PutReq or ChReq.GetReq is set and execute whichever is set. ChReqOp_Auto ChReqOp = 0 // CancelReq tells the server to close/cancel the ChReq referenced by ChReq.ReqID. ChReqOp_CancelReq ChReqOp = 1 // Modifies session access, allowing a caller to do things like: // - establish access as a specific identity // - supply a crypto info, ultimately allowing decryption to occur for subsequent access. ChReqOp_AccessGrant ChReqOp = 2 )
func (ChReqOp) EnumDescriptor ¶
type ChStateURI ¶
type ChStateURI struct {
// DomainName specifies the parent community/context name of the given channel ID. Domain names are how
// channel syndication properties, storage quotas, and prioritization are possible at the vault level.
DomainName string `protobuf:"bytes,1,opt,name=DomainName,proto3" json:"DomainName,omitempty"`
// ChID_TID specifies a channel's TID for a given domain name.
// If this is not set, then the channel ID is considered to be non-binary and is contained in ChID.
ChID_TID []byte `protobuf:"bytes,2,opt,name=ChID_TID,json=ChIDTID,proto3" json:"ChID_TID,omitempty"`
// ChID is a UTF8 string name of this channel.
// IF both ChID and ChID_TID are set, ChID is assumed to contain the base32 representation of ChID_TID.
ChID string `protobuf:"bytes,3,opt,name=ChID,proto3" json:"ChID,omitempty"`
// StateURI is a token that expresses a specific channel state.
// If this is not set, the latest state of the channel is implied.
// By convention this is a POSIX-style pathname in the form "<StateContextID>[/<SubStateID>]*"
StateURI string `protobuf:"bytes,4,opt,name=StateURI,proto3" json:"StateURI,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
ChStateURI fully specifies a channel URI at a given state.
func (*ChStateURI) AssignFromURI ¶
func (uri *ChStateURI) AssignFromURI(uriStr string) error
AssignFromURI parses the given POSIX-style uri string and sets all the fields of this ChStateURI
Input form: "[/]DomainName/ChID"
func (*ChStateURI) Descriptor ¶
func (*ChStateURI) Descriptor() ([]byte, []int)
func (*ChStateURI) FormChURI ¶
func (uri *ChStateURI) FormChURI() (string, error)
FormChURI is the inverse of AssignFromURI()
func (*ChStateURI) GetChID ¶
func (m *ChStateURI) GetChID() string
func (*ChStateURI) GetChID_TID ¶
func (m *ChStateURI) GetChID_TID() []byte
func (*ChStateURI) GetDomainName ¶
func (m *ChStateURI) GetDomainName() string
func (*ChStateURI) GetStateURI ¶
func (m *ChStateURI) GetStateURI() string
func (*ChStateURI) Marshal ¶
func (m *ChStateURI) Marshal() (dAtA []byte, err error)
func (*ChStateURI) MarshalToSizedBuffer ¶
func (m *ChStateURI) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ChStateURI) ProtoMessage ¶
func (*ChStateURI) ProtoMessage()
func (*ChStateURI) Reset ¶
func (m *ChStateURI) Reset()
func (*ChStateURI) Size ¶
func (m *ChStateURI) Size() (n int)
func (*ChStateURI) String ¶
func (m *ChStateURI) String() string
func (*ChStateURI) Unmarshal ¶
func (m *ChStateURI) Unmarshal(dAtA []byte) error
func (*ChStateURI) XXX_DiscardUnknown ¶
func (m *ChStateURI) XXX_DiscardUnknown()
func (*ChStateURI) XXX_Marshal ¶
func (m *ChStateURI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ChStateURI) XXX_Merge ¶
func (m *ChStateURI) XXX_Merge(src proto.Message)
func (*ChStateURI) XXX_Size ¶
func (m *ChStateURI) XXX_Size() int
func (*ChStateURI) XXX_Unmarshal ¶
func (m *ChStateURI) XXX_Unmarshal(b []byte) error
type ChSub ¶
ChSub returns a stream of requested entries, closing Outbox() when complete (or when Close() is called)
type Const ¶
type Const int32
const ( Const_ConstDefs Const = 0 // TIDSz is the byte size of a TID, a hash with a leading embedded big endian binary time index. // The purpose of a TID is that it can be sorted chronologically in order to facilitate // storage, searching, and syndication in large-scale (real-world) TID blob repositories. // // Byte layout is designed so that TIDs are sortable by the embedded timestamp: // 0:6 - Standard UTC timestamp in unix seconds (big endian) // 6:8 - Timestamp fraction (big endian) // 8:30 - Signature/hash Const_TIDSz Const = 30 // TIDEncodedLen is the ASCII-compatible string length of a (binary) TID encoded into its base32 form. Const_TIDEncodedLen Const = 48 // TIDTimestampSz is the number of left-hand bytes in a TID reserved for a time index value. Const_TIDTimestampSz Const = 8 // DefaultGrpcServicePort is the TCP port the service RepoGrpc should run on by default. Const_DefaultGrpcServicePort Const = 5192 )
func (Const) EnumDescriptor ¶
type Domain ¶
type Domain interface {
ctx.Ctx
// Places this Domain on service
Start() error
// OpenChSub services a channel Get request.
OpenChSub(chReq *ChReq) (ChSub, error)
// SubmitTx takes ownership of the given tx and inserts it into the Host pipeline to be validated and merged.
// If the given Tx is retained, it should be treated as read-only at this point onward.
SubmitTx(tx *Tx) error
// DomainName uniquely identifies this Domain
DomainName() string
}
Domain is a channel controlled for a family of channels all sharing the same domain.
type EnclaveAccess ¶
type EnclaveAccess struct {
// Specifies the key pathname for this operation.
Keypath string `protobuf:"bytes,1,opt,name=Keypath,proto3" json:"Keypath,omitempty"`
// This will evolve in time, but in general, the client authenticates by submitting a hash of biometric-based input.
// (e.g. pin, password, key-fob, bio-fingerprints) and a token from the previous session.
// From this, a symmetric key is (re)created and used to access the member's primary key hive (for the given Keypath)
Passhash []byte `protobuf:"bytes,5,opt,name=Passhash,proto3" json:"Passhash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*EnclaveAccess) Descriptor ¶
func (*EnclaveAccess) Descriptor() ([]byte, []int)
func (*EnclaveAccess) GetKeypath ¶
func (m *EnclaveAccess) GetKeypath() string
func (*EnclaveAccess) GetPasshash ¶
func (m *EnclaveAccess) GetPasshash() []byte
func (*EnclaveAccess) Marshal ¶
func (m *EnclaveAccess) Marshal() (dAtA []byte, err error)
func (*EnclaveAccess) MarshalToSizedBuffer ¶
func (m *EnclaveAccess) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EnclaveAccess) ProtoMessage ¶
func (*EnclaveAccess) ProtoMessage()
func (*EnclaveAccess) Reset ¶
func (m *EnclaveAccess) Reset()
func (*EnclaveAccess) Size ¶
func (m *EnclaveAccess) Size() (n int)
func (*EnclaveAccess) String ¶
func (m *EnclaveAccess) String() string
func (*EnclaveAccess) Unmarshal ¶
func (m *EnclaveAccess) Unmarshal(dAtA []byte) error
func (*EnclaveAccess) XXX_DiscardUnknown ¶
func (m *EnclaveAccess) XXX_DiscardUnknown()
func (*EnclaveAccess) XXX_Marshal ¶
func (m *EnclaveAccess) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EnclaveAccess) XXX_Merge ¶
func (m *EnclaveAccess) XXX_Merge(src proto.Message)
func (*EnclaveAccess) XXX_Size ¶
func (m *EnclaveAccess) XXX_Size() int
func (*EnclaveAccess) XXX_Unmarshal ¶
func (m *EnclaveAccess) XXX_Unmarshal(b []byte) error
type ErrCode ¶
type ErrCode int32
ErrCode expresses status and error codes.
const ( ErrCode_NoErr ErrCode = 0 ErrCode_UnnamedErr ErrCode = 5000 ErrCode_InternalErr ErrCode = 5001 ErrCode_UnsupporteReqOp ErrCode = 5002 ErrCode_ReqCanceled ErrCode = 5003 ErrCode_ShuttingDown ErrCode = 5004 ErrCode_Disconnected ErrCode = 5005 ErrCode_ReqIDNotFound ErrCode = 5010 ErrCode_InvalidKeypath ErrCode = 5020 ErrCode_InvalidURI ErrCode = 5021 ErrCode_FailedToOpenChURI ErrCode = 5022 ErrCode_NothingToCommit ErrCode = 5030 ErrCode_CommitFailed ErrCode = 5031 ErrCode_DomainNotFound ErrCode = 5032 ErrCode_CorruptChEntry ErrCode = 5040 ErrCode_ViolatesAppendOnly ErrCode = 5100 ErrCode_InsufficientPermissions ErrCode = 5101 ErrCode_ChProtocolNotRecognized ErrCode = 5201 )
func (ErrCode) EnumDescriptor ¶
func (ErrCode) ErrWithMsg ¶
ErrWithMsg returns a ReqErr with the given error code and msg set.
func (ErrCode) ErrWithMsgf ¶
ErrWithMsgf returns a ReqErr with the given error code and formattable msg set.
type GetOp ¶
type GetOp struct {
// Keypath and Scope together imply which entries are returned.
Keypath string `protobuf:"bytes,2,opt,name=Keypath,proto3" json:"Keypath,omitempty"`
Scope KeypathScope `protobuf:"varint,3,opt,name=Scope,proto3,enum=repo.KeypathScope" json:"Scope,omitempty"`
// MaintainSync causes the ChReq to remain open and receive state updates for qualifying keypaths via ChSyncSuspend/ChSyncResume
MaintainSync bool `protobuf:"varint,9,opt,name=MaintainSync,proto3" json:"MaintainSync,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
GetOp gets the all the channel entries for the given Keypath and the specified scope.
func (*GetOp) Descriptor ¶
func (*GetOp) GetKeypath ¶
func (*GetOp) GetMaintainSync ¶
func (*GetOp) GetScope ¶
func (m *GetOp) GetScope() KeypathScope
func (*GetOp) ProtoMessage ¶
func (*GetOp) ProtoMessage()
func (*GetOp) XXX_DiscardUnknown ¶
func (m *GetOp) XXX_DiscardUnknown()
func (*GetOp) XXX_Marshal ¶
func (*GetOp) XXX_Unmarshal ¶
type GrpcServer ¶
GrpcServer is the GRPC implementation of repo.proto
func NewGrpcServer ¶
func NewGrpcServer(host Host, listenNetwork string, listenAddr string) *GrpcServer
NewGrpcServer creates a new GrpcServer
func (*GrpcServer) RepoServiceSession ¶
func (srv *GrpcServer) RepoServiceSession(rpc RepoGrpc_RepoServiceSessionServer) error
RepoServiceSession is the Grpc session a client opens and keeps open. Multiple pipes can be open at any time by the same client or multiple clients.
func (*GrpcServer) StreamServerInterceptor ¶
func (srv *GrpcServer) StreamServerInterceptor() grpc.StreamServerInterceptor
StreamServerInterceptor is a debugging helper
func (*GrpcServer) UnaryServerInterceptor ¶
func (srv *GrpcServer) UnaryServerInterceptor() grpc.UnaryServerInterceptor
UnaryServerInterceptor is a debugging helper
type Host ¶
type Host interface {
ctx.Ctx
Domain
// TODO: see comments in RepoServiceSession()
NewSession() MemberSession
}
Host is the highest level repo controller. It accepts incoming txns, report status of their processing, and serves channel content.
func NewHost ¶
func NewHost( params HostParams, ) (Host, error)
NewHost is the highest level interface for what this repo package is all about
type HostParams ¶
HostParams provide all the params a Host needs to run from start to end
type KeypathScope ¶
type KeypathScope int32
KeypathScope specifies which entires are considered relevant to a given Keypath.
const ( KeypathScope_NoScope KeypathScope = 0 KeypathScope_EntryAtKeypath KeypathScope = 1 KeypathScope_Shallow KeypathScope = 2 KeypathScope_ShallowAndDeep KeypathScope = 4 )
func (KeypathScope) EnumDescriptor ¶
func (KeypathScope) EnumDescriptor() ([]byte, []int)
func (KeypathScope) String ¶
func (x KeypathScope) String() string
type LID ¶
type LID uint32
LID is the local assigned ID, an integer assigned the given channel for brevity and look
type MemberSession ¶
type MemberSession interface {
// ExpandAccess enables access into a secure enclave (for key direct or indirect access).
// Currently, this is simply a master key that unlocks a key hive so that the user associated with this session can sign newly authored txns and decrypt private traffic.
// In the future, these are paramters that connect (and drive) a physical keyfob to prompt the user to authenticate (via physical interaction or biometric input).
ExpandAccess(access *EnclaveAccess) error
// Accesses the currently set of activated enclaves and attempts to sign a newly authored transaction
EncodeToTxAndSign(txOp *TxOp) (*Tx, error)
}
MemberSession wraps access to a secure enclave, allowing an interface consumer to perform security services (on behalf of a community member).
type Node ¶
type Node struct {
// Op tells the client with this channel open that kind of Node this is.
Op NodeOp `protobuf:"varint,1,opt,name=Op,proto3,enum=repo.NodeOp" json:"Op,omitempty"`
// ReqID references the originating ChReq that this Node is in response to.
ReqID int32 `protobuf:"varint,2,opt,name=ReqID,proto3" json:"ReqID,omitempty"`
// Keypath is a POSIX-style pathname of this channel entry (for safety, "/" specifies the root path, not "").
// Each path component in a valid Keypath must have a length of at least 2.
Keypath string `protobuf:"bytes,5,opt,name=Keypath,proto3" json:"Keypath,omitempty"`
// RevID is the timestamp when this entry was submitted to the host channel in UTC seconds (where one sec is 2^16 ticks)
RevID int64 `protobuf:"varint,10,opt,name=RevID,proto3" json:"RevID,omitempty"`
// ParentRevID identifies the RevID of the Node instance that this node is replacing.
// If this is 0, a Node at this keypath did not exist when this Node was submitted.
ParentRevID int64 `protobuf:"varint,11,opt,name=ParentRevID,proto3" json:"ParentRevID,omitempty"`
// TypeID is a "multi-codec" style (POSIX-style type pathname) that self-describes this Node and the information within it.
TypeID string `protobuf:"bytes,15,opt,name=TypeID,proto3" json:"TypeID,omitempty"`
// GlyphURI is a loose analog to the conventional use of "icon" and refer to a unit-sized graphic or volume.
// Glyph URIs can allow the encoding of arbitrary parameters (such as color), allowing variants to be offered at no cost.
// A given glyph URI often has both a 2D ("sprite") and 3D object form and is chosen based on where it's instanced.
GlyphURI string `protobuf:"bytes,20,opt,name=GlyphURI,proto3" json:"GlyphURI,omitempty"`
ScaleMode NodeScaleMode `protobuf:"varint,21,opt,name=ScaleMode,proto3,enum=repo.NodeScaleMode" json:"ScaleMode,omitempty"`
// Text is a human readable descriptor for this item, with TextFormat describing what format it's in.
Text string `protobuf:"bytes,22,opt,name=Text,proto3" json:"Text,omitempty"`
TextFormat TextFormat `protobuf:"varint,23,opt,name=TextFormat,proto3,enum=repo.TextFormat" json:"TextFormat,omitempty"`
// Optional values that can express needed values in accordance of TypeID.
Str string `protobuf:"bytes,24,opt,name=Str,proto3" json:"Str,omitempty"`
Int int64 `protobuf:"varint,25,opt,name=Int,proto3" json:"Int,omitempty"`
// Attachment is useful to attach any buffer, typically decoded based on Node.Op, Node.Keypath, or Node.TypeID.
// Max size is limited to ~ 3.5MB.
Attachment []byte `protobuf:"bytes,30,opt,name=Attachment,proto3" json:"Attachment,omitempty"`
// AssetURI specifies an asset URI (typically implicitly placed at this node's position, scale, and orientation.
// Asset URIs allow the encoding of arbitrary parameters (such as color), allowing variants to be offered at no cost.
AssetURI string `protobuf:"bytes,35,opt,name=AssetURI,proto3" json:"AssetURI,omitempty"`
// X1, X2, and X3 are coordinates or values expressed in any unit.
// A channel client can later declare how to interpret these coordinates so that a channel server and provide indexed services.
// Shoutout to the 3 domains that reflect all theoretical completeness: alpha (finite), omega (unending), and the inaccessible cardinal(s).
// Special thanks to Michael at Vsauce: https://www.youtube.com/watch?v=SrU9YDoXE88
X1 float64 `protobuf:"fixed64,41,opt,name=X1,proto3" json:"X1,omitempty"`
X2 float64 `protobuf:"fixed64,42,opt,name=X2,proto3" json:"X2,omitempty"`
X3 float64 `protobuf:"fixed64,43,opt,name=X3,proto3" json:"X3,omitempty"`
// Scale1 to Scale3 express the scale of this Node.
// If all three values are 0, they are all implicitly 1.
// If Scale2 or Scale3 == 0, then it is implicitly Scale1.
Scale1 float32 `protobuf:"fixed32,51,opt,name=Scale1,proto3" json:"Scale1,omitempty"`
Scale2 float32 `protobuf:"fixed32,52,opt,name=Scale2,proto3" json:"Scale2,omitempty"`
Scale3 float32 `protobuf:"fixed32,53,opt,name=Scale3,proto3" json:"Scale3,omitempty"`
// Rotate1 - Rotate3 the orientation of this Node using Euler angles.
Rotate1 float32 `protobuf:"fixed32,60,opt,name=Rotate1,proto3" json:"Rotate1,omitempty"`
Rotate2 float32 `protobuf:"fixed32,61,opt,name=Rotate2,proto3" json:"Rotate2,omitempty"`
Rotate3 float32 `protobuf:"fixed32,62,opt,name=Rotate3,proto3" json:"Rotate3,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Node is the generalized response object a server sends to the client as it processes each ChReq sent by the client. Node is also the standard "atomic" unit of information in a channel. A repo channel is a key-value trie data structure where Node.Keypath maps to a Node body.
func (*Node) Descriptor ¶
func (*Node) GetAssetURI ¶
func (*Node) GetAttachment ¶
func (*Node) GetGlyphURI ¶
func (*Node) GetKeypath ¶
func (*Node) GetParentRevID ¶
func (*Node) GetRotate1 ¶
func (*Node) GetRotate2 ¶
func (*Node) GetRotate3 ¶
func (*Node) GetScaleMode ¶
func (m *Node) GetScaleMode() NodeScaleMode
func (*Node) GetTextFormat ¶
func (m *Node) GetTextFormat() TextFormat
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) XXX_DiscardUnknown ¶
func (m *Node) XXX_DiscardUnknown()
func (*Node) XXX_Unmarshal ¶
type NodeOp ¶
type NodeOp int32
NodeOp is a collection of NodeOp values that express how a Node is to be interpreted.
const ( // NodeUpdate means this Node should update/overwrite the Node that is already at the given Keypath. NodeOp_NodeUpdate NodeOp = 0 // NodeRemove means the Node at the given Keypath path should be deleted/removed. NodeOp_NodeRemove NodeOp = 2 // NodeRemoveAll is similar to NodeRemove, but includes all sub keypaths. NodeOp_NodeRemoveAll NodeOp = 3 // ReqComplete means the referenced request (via Node.ReqID) has successfully completed. // Other values in the Node are contextual based on request that was completed. NodeOp_ReqComplete NodeOp = 10 // ReqDiscarded means the referenced request failed and/or has been canceled. // If Node.Attachment != nil, then it is a serialized ReqErr describing why it was discarded. // As with ReqComplete, the referenced request is now complete, so the given ReqID is now available for (re)use. NodeOp_ReqDiscarded NodeOp = 11 // ChSyncSuspend signals to the client that a state update is about to be sent (in the form of a sequence of entry ops). // When all state change messages have been sent, the server sends ChSyncResume. NodeOp_ChSyncSuspend NodeOp = 20 // ChSyncResume signals that all pending state changes are have been sent (i.e. channel state is now synced) // If Node.Str is set, it's set to a StateURI that represents the current channel state. NodeOp_ChSyncResume NodeOp = 21 )
func (NodeOp) EnumDescriptor ¶
type NodeScaleMode ¶
type NodeScaleMode int32
const ( NodeScaleMode_AutoScale NodeScaleMode = 0 NodeScaleMode_FixedScale NodeScaleMode = 1 )
func (NodeScaleMode) EnumDescriptor ¶
func (NodeScaleMode) EnumDescriptor() ([]byte, []int)
func (NodeScaleMode) String ¶
func (x NodeScaleMode) String() string
type RawTx ¶
type RawTx struct {
// TID identifies this Txn (and is a hash or signature for contained Tx)
TID []byte `protobuf:"bytes,1,opt,name=TID,proto3" json:"TID,omitempty"`
// TxnStatus information about the associated txn
TxnStatus TxnStatus `protobuf:"varint,2,opt,name=TxnStatus,proto3,enum=repo.TxnStatus" json:"TxnStatus,omitempty"`
Header []byte `protobuf:"bytes,10,opt,name=Header,proto3" json:"Header,omitempty"`
Body []byte `protobuf:"bytes,11,opt,name=Body,proto3" json:"Body,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
RawTx reflects a Tx that has been is packed and sealed.
func (*RawTx) Descriptor ¶
func (*RawTx) GetTxnStatus ¶
func (*RawTx) ProtoMessage ¶
func (*RawTx) ProtoMessage()
func (*RawTx) XXX_DiscardUnknown ¶
func (m *RawTx) XXX_DiscardUnknown()
func (*RawTx) XXX_Marshal ¶
func (*RawTx) XXX_Unmarshal ¶
type RepoGrpcClient ¶
type RepoGrpcClient interface {
// RepoServiceSession opens the specified channel at a given state and executes a stream of requests from the client.
// The return stream reports completion or status of active requests and remains open as long as the client stream remains open.
// The beating heart of PLAN: channels, streams, information, security, trust, sessions.
RepoServiceSession(ctx context.Context, opts ...grpc.CallOption) (RepoGrpc_RepoServiceSessionClient, error)
}
RepoGrpcClient is the client API for RepoGrpc service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewRepoGrpcClient ¶
func NewRepoGrpcClient(cc *grpc.ClientConn) RepoGrpcClient
type RepoGrpcServer ¶
type RepoGrpcServer interface {
// RepoServiceSession opens the specified channel at a given state and executes a stream of requests from the client.
// The return stream reports completion or status of active requests and remains open as long as the client stream remains open.
// The beating heart of PLAN: channels, streams, information, security, trust, sessions.
RepoServiceSession(RepoGrpc_RepoServiceSessionServer) error
}
RepoGrpcServer is the server API for RepoGrpc service.
type ReqErr ¶
type ReqErr struct {
Code ErrCode `protobuf:"varint,1,opt,name=Code,proto3,enum=repo.ErrCode" json:"Code,omitempty"`
// Msg is a human-readable info string that offers amplifying info about the given error.
Msg string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
ReqErr wraps errors and is typically used in conjunction with NodeOp.ChReqErr
func (*ReqErr) Descriptor ¶
func (*ReqErr) MarshalToSizedBuffer ¶
func (*ReqErr) ProtoMessage ¶
func (*ReqErr) ProtoMessage()
func (*ReqErr) XXX_DiscardUnknown ¶
func (m *ReqErr) XXX_DiscardUnknown()
func (*ReqErr) XXX_Marshal ¶
func (*ReqErr) XXX_Unmarshal ¶
type ResolveMode ¶
type ResolveMode int32
const ( ResolveMode_Raw ResolveMode = 0 ResolveMode_ResolveByTime ResolveMode = 1 ResolveMode_ResolveByMemberRank ResolveMode = 2 ResolveMode_ResolveByGrantRank ResolveMode = 3 )
func (ResolveMode) EnumDescriptor ¶
func (ResolveMode) EnumDescriptor() ([]byte, []int)
func (ResolveMode) String ¶
func (x ResolveMode) String() string
type TID ¶
type TID []byte
TID identifies a specific transaction, community, channel, or channel entry.
func (TID) CopyNext ¶
CopyNext copies the given TID and increments it by 1, typically useful for seeking the next entry after a given one.
func (TID) ExtractTime ¶
ExtractTime returns the unix timestamp embedded in this TID (a unix timestamp in seconds UTC)
func (TID) ExtractTimeFS ¶
ExtractTimeFS returns the unix timestamp embedded in this TID (a unix timestamp in 1<<16 seconds UTC)
func (TID) SelectEarlier ¶
SelectEarlier looks in inTime a chooses whichever is earlier.
If t is later than the time embedded in this TID, then this function has no effect and returns false.
If t is earlier, then this TID is initialized to t (and the rest zeroed out) and returns true.
func (TID) SetTimeAndHash ¶
SetTimeAndHash writes the given timestamp and the right-most part of inSig into this TID.
See comments for Const_TIDSz
type TextFormat ¶
type TextFormat int32
const ( TextFormat_PlainText TextFormat = 0 TextFormat_RTF TextFormat = 1 TextFormat_HTML TextFormat = 2 )
func (TextFormat) EnumDescriptor ¶
func (TextFormat) EnumDescriptor() ([]byte, []int)
func (TextFormat) String ¶
func (x TextFormat) String() string
type Tx ¶
type Tx struct {
// Derivative content (set to nil for serialization)
TID []byte `protobuf:"bytes,1,opt,name=TID,proto3" json:"TID,omitempty"`
Hash []byte `protobuf:"bytes,2,opt,name=Hash,proto3" json:"Hash,omitempty"`
// Content
TxOp *TxOp `protobuf:"bytes,10,opt,name=TxOp,proto3" json:"TxOp,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Tx contains all the info for a channel changeset. TODO -- this is a short-term workaround to get things running and it contents will be replaced with proper fields.
func (*Tx) Descriptor ¶
func (*Tx) ProtoMessage ¶
func (*Tx) ProtoMessage()
func (*Tx) XXX_DiscardUnknown ¶
func (m *Tx) XXX_DiscardUnknown()
func (*Tx) XXX_Unmarshal ¶
type TxOp ¶
type TxOp struct {
// ChStateURI expresses the channel URI that this op applies to.
ChStateURI *ChStateURI `protobuf:"bytes,3,opt,name=ChStateURI,proto3" json:"ChStateURI,omitempty"`
// ChannelGenesis creates a new channel in the domain name specified in ChReq.URI.
// ChReq.Entries[] are entries that are written into the new channel (and are part of the genesis tx).
// In the corresponding reply ReqComplete message, Node.Str is set to the URI of the newly created channel.
ChannelGenesis bool `protobuf:"varint,4,opt,name=ChannelGenesis,proto3" json:"ChannelGenesis,omitempty"`
// Entries are changes to be applied to the target channel.
Entries []*Node `protobuf:"bytes,6,rep,name=Entries,proto3" json:"Entries,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
TxOp atomically commits Entries[] (patches) to the given channel URI In the corresponding reply ReqComplete message, Node.Attachment is set to the resulting TxID.
func (*TxOp) Descriptor ¶
func (*TxOp) GetChStateURI ¶
func (m *TxOp) GetChStateURI() *ChStateURI
func (*TxOp) GetChannelGenesis ¶
func (*TxOp) GetEntries ¶
func (*TxOp) ProtoMessage ¶
func (*TxOp) ProtoMessage()
func (*TxOp) XXX_DiscardUnknown ¶
func (m *TxOp) XXX_DiscardUnknown()
func (*TxOp) XXX_Unmarshal ¶
type TxnStatus ¶
type TxnStatus int32
TxnStatus describes the status of a Tx or RawTx
const ( // New means tx is yet to be committed to storage TxnStatus_New TxnStatus = 0 )
func (TxnStatus) EnumDescriptor ¶
type UnimplementedRepoGrpcServer ¶
type UnimplementedRepoGrpcServer struct {
}
UnimplementedRepoGrpcServer can be embedded to have forward compatible implementations.
func (*UnimplementedRepoGrpcServer) RepoServiceSession ¶
func (*UnimplementedRepoGrpcServer) RepoServiceSession(srv RepoGrpc_RepoServiceSessionServer) error