Documentation ¶
Index ¶
- Constants
- Variables
- func Assert(inCond bool, inMsg string)
- func Assertf(inCond bool, inFormat string, inArgs ...interface{})
- func BinEncode(in []byte) string
- func CreateNewDir(inBasePath, inPath string) (string, error)
- func IsError(inErr error, inErrCodes ...int32) bool
- func MakeFSFriendly(inName string, inSuffix []byte) string
- func Now() int64
- func SetupBaseDir(inLocalPath string, inCreate bool) (string, error)
- type Block
- func (block *Block) AddBlock(inBlock *Block)
- func (block *Block) AddContentWithCodec(inContent []byte, inCodec string)
- func (block *Block) AddContentWithLabel(inContent []byte, inLabel string)
- func (*Block) Descriptor() ([]byte, []int)
- func (block *Block) GetBlockWithCodec(inCodec string, inCodecCode uint32) *Block
- func (block *Block) GetBlockWithLabel(inLabel string) *Block
- func (block *Block) GetBlocksWithCodec(inCodec string, inCodecCode uint32) []*Block
- func (block *Block) GetBlocksWithLabel(inLabel string) []*Block
- func (m *Block) GetCodec() string
- func (m *Block) GetCodecCode() uint32
- func (m *Block) GetContent() []byte
- func (m *Block) GetContentStr() string
- func (block *Block) GetContentWithCodec(inCodec string, inCodecCode uint32) []byte
- func (block *Block) GetContentWithLabel(inLabel string) []byte
- func (m *Block) GetLabel() string
- func (m *Block) GetSubs() []*Block
- func (block *Block) InvokeBlocksWithCodec(inCodec string, inCodecCode uint32, inCallback func(inMatch *Block) error) error
- func (m *Block) Marshal() (dAtA []byte, err error)
- func (m *Block) MarshalTo(dAtA []byte) (int, error)
- func (*Block) ProtoMessage()
- func (m *Block) Reset()
- func (m *Block) Size() (n int)
- func (m *Block) String() string
- func (m *Block) Unmarshal(dAtA []byte) error
- func (m *Block) XXX_DiscardUnknown()
- func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Block) XXX_Merge(src proto.Message)
- func (m *Block) XXX_Size() int
- func (m *Block) XXX_Unmarshal(b []byte) error
- type BlockSearchScope
- type ChID
- type ChIDBlob
- type ChInvocation
- func (*ChInvocation) Descriptor() ([]byte, []int)
- func (m *ChInvocation) GetChAdapterID() string
- func (m *ChInvocation) GetChID() []byte
- func (m *ChInvocation) GetChProtocol() string
- func (m *ChInvocation) Marshal() (dAtA []byte, err error)
- func (m *ChInvocation) MarshalTo(dAtA []byte) (int, error)
- func (*ChInvocation) ProtoMessage()
- func (m *ChInvocation) Reset()
- func (m *ChInvocation) Size() (n int)
- func (m *ChInvocation) String() string
- func (m *ChInvocation) Unmarshal(dAtA []byte) error
- func (m *ChInvocation) XXX_DiscardUnknown()
- func (m *ChInvocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ChInvocation) XXX_Merge(src proto.Message)
- func (m *ChInvocation) XXX_Size() int
- func (m *ChInvocation) XXX_Unmarshal(b []byte) error
- type CommunityID
- type Err
- type Link
- func (*Link) Descriptor() ([]byte, []int)
- func (m *Link) GetDesc() string
- func (m *Link) GetLabel() string
- func (m *Link) GetURI() string
- func (m *Link) Marshal() (dAtA []byte, err error)
- func (m *Link) MarshalTo(dAtA []byte) (int, error)
- func (*Link) ProtoMessage()
- func (m *Link) Reset()
- func (m *Link) Size() (n int)
- func (m *Link) String() string
- func (m *Link) Unmarshal(dAtA []byte) error
- func (m *Link) XXX_DiscardUnknown()
- func (m *Link) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Link) XXX_Merge(src proto.Message)
- func (m *Link) XXX_Size() int
- func (m *Link) XXX_Unmarshal(b []byte) error
- type MemberAlias
- type MemberID
- type Multicodec
- type ServiceInfo
- func (*ServiceInfo) Descriptor() ([]byte, []int)
- func (m *ServiceInfo) GetAddr() string
- func (m *ServiceInfo) GetDesc() string
- func (m *ServiceInfo) GetNameID() string
- func (m *ServiceInfo) GetNetwork() string
- func (m *ServiceInfo) GetNodeID() []byte
- func (m *ServiceInfo) GetServiceType() ServiceType
- func (m *ServiceInfo) Marshal() (dAtA []byte, err error)
- func (m *ServiceInfo) MarshalTo(dAtA []byte) (int, error)
- func (*ServiceInfo) ProtoMessage()
- func (m *ServiceInfo) Reset()
- func (m *ServiceInfo) Size() (n int)
- func (m *ServiceInfo) String() string
- func (m *ServiceInfo) Unmarshal(dAtA []byte) error
- func (m *ServiceInfo) XXX_DiscardUnknown()
- func (m *ServiceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ServiceInfo) XXX_Merge(src proto.Message)
- func (m *ServiceInfo) XXX_Size() int
- func (m *ServiceInfo) XXX_Unmarshal(b []byte) error
- type ServiceType
- type Status
- func (*Status) Descriptor() ([]byte, []int)
- func (m *Status) GetCode() int32
- func (m *Status) GetMsg() string
- func (m *Status) GetParams() []*Val
- func (m *Status) Marshal() (dAtA []byte, err error)
- func (m *Status) MarshalTo(dAtA []byte) (int, error)
- func (*Status) ProtoMessage()
- func (m *Status) Reset()
- func (m *Status) Size() (n int)
- func (m *Status) String() string
- func (m *Status) Unmarshal(dAtA []byte) error
- func (m *Status) XXX_DiscardUnknown()
- func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Status) XXX_Merge(src proto.Message)
- func (m *Status) XXX_Size() int
- func (m *Status) XXX_Unmarshal(b []byte) error
- type StorageID
- type TID
- func (tid TID) Blob() TIDBlob
- func (tid TID) Clone() TID
- func (tid TID) CopyNext(inTID TID)
- func (tid TID) ExtractChID() ChID
- func (tid TID) ExtractTime() int64
- func (tid TID) ExtractTimeFS() TimeFS
- func (tid TID) IsNil() bool
- func (tid TID) PrefixStr() string
- func (tid TID) SelectEarlier(inTime TimeFS) bool
- func (tid TID) SetHash(inHash []byte)
- func (tid TID) SetTimeAndHash(inTime TimeFS, inHash []byte)
- func (tid TID) SetTimeFS(inTime TimeFS)
- func (tid TID) Str() string
- func (tid TID) SuffixStr() string
- type TIDBlob
- type TimeFS
- type Val
- func (*Val) Descriptor() ([]byte, []int)
- func (m *Val) GetBlock() *Block
- func (m *Val) GetFloat() float64
- func (m *Val) GetInt() int64
- func (m *Val) GetName() string
- func (m *Val) GetStr() string
- func (m *Val) GetValType() ValType
- func (m *Val) Marshal() (dAtA []byte, err error)
- func (m *Val) MarshalTo(dAtA []byte) (int, error)
- func (*Val) ProtoMessage()
- func (m *Val) Reset()
- func (m *Val) Size() (n int)
- func (m *Val) String() string
- func (m *Val) Unmarshal(dAtA []byte) error
- func (m *Val) XXX_DiscardUnknown()
- func (m *Val) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Val) XXX_Merge(src proto.Message)
- func (m *Val) XXX_Size() int
- func (m *Val) XXX_Unmarshal(b []byte) error
- type ValType
Constants ¶
const ( // GenericErrorFamily errors generally relate to pnode GenericErrorFamily int32 = 5000 + iota // AssertFailed means an unreachable part of code was...reached. :\ AssertFailed // ParamErr means one or more params was missing, nil, or malformed. ParamErr // MarshalFailed means Marshal() returned an error MarshalFailed // UnmarshalFailed means Unmarshal() returned an error UnmarshalFailed // Unimplemented means flow hit a point requiring deeper implementation Unimplemented // FileSysError means an unexpected file sys error occured FileSysError // ConfigNotRead denotes that the given file was not found/read ConfigNotRead // ServiceShutdown means the host service is either shutting down is shutdown ServiceShutdown // RepoEntryErrorFamily errors generally relate to prepo RepoEntryErrorFamily = 5100 + iota // BadPDIEntryFormat means the PDI entry being processed is corrupted or was created using an unsupported format BadPDIEntryFormat // CommunityNotFound means the specified community name or ID did not match any of the registered communities CommunityNotFound // CommunityEpochNotFound means the community epoch ID cited was not found in this repo. CommunityEpochNotFound // CommunityKeyNotAvailable means no community key sessions knew of the given community key. CommunityKeyNotAvailable // FailedToConnectStorageProvider means the connection attempt the StorageProvider failed FailedToConnectStorageProvider // MemberEpochNotFound means the given member ID and/or member epoch num was not found MemberEpochNotFound // ChannelNotFound means the given ChannelID was not found in the community repo ChannelNotFound // ChannelSessionNotFound means the given channel session ID did not reference an active channel session. ChannelSessionNotFound // FailedToLoadChannel means a channel failed to load all its files from its host community repo FailedToLoadChannel // ChAgentNotFound means the requested channel agent was not found ChAgentNotFound // InvalidEntrySignature means the entry did not match the signature computed for the given entry body and the author's corresponding verify sig InvalidEntrySignature // AuthorNotFound means the given author was not found in the given access control list. AuthorNotFound // ACCNotFound means the access channel specified by a given PDI entry was not found ACCNotFound // NotAnACC means the channel ID cited by a PDI entry was not actually an access channel NotAnACC // FailedToProcessPDIHeader means decryption or unmarshalling of a PDI failed FailedToProcessPDIHeader // ViolatesCommunityEpoch means the given entry being processed is inconsistent or violates a constraint established in the governing community epoch. ViolatesCommunityEpoch // ChEntryIsMalformed means decryption or unmarshalling of a pdi channel entry failed ChEntryIsMalformed // ChEntryNotMerged means the given entry cannot yet be merged and must wait ChEntryNotMerged // ChEntryIsNotLive means the requested entry is not currently live ChEntryIsNotLive // AuthorLacksWritePermission means the given PDI entry's author does not have write permission to the specified channel AuthorLacksWritePermission // BadTimestamp means a timestamp is in the excessively distant past or future BadTimestamp // ChannelEpochNotFound means the cited epoch of the target channel did not match any known epochs locally. ChannelEpochNotFound // ChannelEpochNotLive means the cited channel epoch is not currently live ChannelEpochNotLive // ChannelEpochDisallows means the entry does not conform to its cited channel epoch ChannelEpochDisallows // ChannelEpochExpired means the cited channel epoch has been superseded and does not allow the given entry. ChannelEpochExpired // GenesisEntryNotVerified means an entry was marked as a genesis entry but could not be verified. GenesisEntryNotVerified // TxnDBNotReady means the txnDB failed to read or write txn data TxnDBNotReady // TxnNotConsistent means info in one or more txns is at odds, meaning malicious txn packaging may be in play TxnNotConsistent // StorageNotConsistent means the storae provider returned info that is suspect or inconsistent StorageNotConsistent // TxnDecodeFailed means the given txn failed to be decoded TxnDecodeFailed // UnsupportedPayloadCodec means the given txn payload codec type is not recognized or supported UnsupportedPayloadCodec // CannotExtractTxnPayload means the txn payload failed to be extracted CannotExtractTxnPayload // SecurityErrorFamily errors relate to PLAN's Secure Key Interface (SKI) SecurityErrorFamily = 5200 + iota // KeyringNotFound means the given key set was not found KeyringNotFound // KeyEntryNotFound means a key source did not contain the requested pub key (or pub key fragment) KeyEntryNotFound // InvocationNotAvailable means an SKI session was started with an unrecognized invocation string InvocationNotAvailable // InvocationAlreadyExists means an ski.Provider has already been registered with the given invocation string InvocationAlreadyExists // CryptoKitIDAlreadyRegistered means the given package ID was already registered CryptoKitIDAlreadyRegistered // CryptoKitNotFound means the requested CryptoKitID was not registered for any CryptoKitID CryptoKitNotFound // HashKitNotFound means the requested HashKitID was not found HashKitNotFound // KeyGenerationFailed means key generation failed KeyGenerationFailed // KeyringNotSpecified means no keyring scope name was given for the SKI operation KeyringNotSpecified // CommunityNotSpecified means inArgs.KeySpecs.CommunityID was not set (and so the op can't proceed) CommunityNotSpecified // UnknownSKIOpName means the given SKI op name was not recognized UnknownSKIOpName // InsufficientSKIAccess means the requested permissions were not issued to allow the operation to proceed InsufficientSKIAccess // InvalidSKISession means the given session is not currently open InvalidSKISession // KeyIDCollision occurs when a key is placed in a keyring that already contains the key ID KeyIDCollision // KeyImportFailed means one or more keys that tried to be imported failed. KeyImportFailed // BadKeyFormat means key data was a length or format that was invalid or unexpected BadKeyFormat // FailedToDecryptKeyImport means a PDI entry body content failed to decrypt FailedToDecryptKeyImport // FailedToProcessKeyImport means that an error occurred while processing a PDI key import FailedToProcessKeyImport // FailedToMarshalKeyExport means an error occurred while encoding a PDI key export FailedToMarshalKeyExport // FailedToDecryptData means either the key or buffer to to be decrypted failed verification, FailedToDecryptData // VerifySignatureFailed means either the given signature did not match the given digest. VerifySignatureFailed // KeyTomeFailedToLoad means the cold storage for a keyring failed to load or does not exist KeyTomeFailedToLoad // KeyTomeFailedToWrite means an error occured while trying to write a key file KeyTomeFailedToWrite // StorageErrorFamily errors relate to PLAN's PDI Storage abstraction StorageErrorFamily = 5300 + iota // InvalidStorageSession means the given storage session ID was not found InvalidStorageSession // InvalidDatabaseID means the database ID provided is suspiciously short or long InvalidDatabaseID // FailedToAccessPath means a pathname was unable to be created or otherwise accessed FailedToAccessPath // FailedToLoadDatabase means an error was encountered when creating or loading the database FailedToLoadDatabase // FailedToCommitTxns means an unexpected fatal error occurred while committing one ore more txns FailedToCommitTxns // IncompatibleStorage means the given TxnEncoder desc string reflects that the SP and client are incompatible IncompatibleStorage // EncoderSessionNotReady means that TxnEncoder.ResetSession() has either not yet been called or the SKI session associated with it has closed. EncoderSessionNotReady // StorageImplNotFound means the requested storage impl is not available, etc. StorageImplNotFound // TxnPartsMissing means one or more required txn parts are not present TxnPartsMissing // AccountNotAvailable means the StorageProvider failed to find the account associated w/ the txn's "from" public key (or is damaged) AccountNotAvailable // InsufficientPostage means the sender does not have a balance to commit their txn InsufficientPostage // TransferFailed means the gas/fiat transfer failed (e.g. insufficient funds) TransferFailed // StorageNotReady means a problem occurred at the storage level StorageNotReady // NetworkNotReady means the network is in an unusable state NetworkNotReady // ConfigFailure means something went wrong loading/reading config ConfigFailure // TxnQueryFailed means the txn query failed to execute TxnQueryFailed // TxnFailedToDecode means TxnDecoder.DecodeRawTxn() returned an error TxnFailedToDecode // NetworkErrorFamily errors generally relate to network services and connections NetworkErrorFamily = 5400 + iota )
const ( // CommunityIDSz is the number of bytes used to to identify a PLAN community ID. // Background on probability of hash collision: http://preshing.com/20110504/hash-collision-probabilities/ // Should this be smaller or larger? Philosophically, this value expresses the size of the hash universe, // where nodes can "safely" generate hashnames alongside peers. 2^192 outta be enough for anybody. CommunityIDSz = 24 // SymmetricPubKeySz is the number of bytes used to identify a symmetric key entry on a PLAN keyring. // It's "modest-sized" since a newly generated keys must pass collision checks before being put into use. SymmetricPubKeySz = 16 // WorkstationIDSz is the number of bytes used to to identify a PLAN workstation ID. WorkstationIDSz = 16 // ChIDSz specifies the byte size of a PLAN channel ID (and is the right-most bytes of a TID. ChIDSz = 18 // TIDSz is the number of bytes for a TID ("time ID") // Having 20 hash bytes is as strong as Ethereum and Bitcoin's address system. // // Byte layout is designed so that TIDs are sortable by an embedded timestamp: // 0:6 - Standard UTC timestamp in unix seconds (BE) // 6:8 - Timestamp fraction (BE) // 8:27 - Signature/hash bytes TIDSz = 27 // MemberIDSz is the byte size of a MemberID MemberIDSz = 4 // MemberAliasMaxLen is the max UTF8 string length a community member can use for their member alias MemberAliasMaxLen = 127 )
const ( DefaultStorageProviderServicePort = "5190" // hosts the grpc service StorageProvider, used for serving Repo clients. DefaultRepoServicePort = "5191" // hosts the grpc service Repo, used for serving PLAN clients. DefaultWorkstationServicePort = "5192" // hosts the gprc service WsService, used for serving PLAN workstations. )
Default ports used in PLAN
const ( // TimeFSMax is the largest possible TimeFS value TimeFSMax = TimeFS(DistantFuture) // DistantFuture is a const used to express the "distant future" in unix time. DistantFuture int64 = (1 << 63) - 1 // DistantPast is a const used to express the "distant past" in unix time. DistantPast int64 = -DistantFuture )
const CodecCodeForBlock = 0x0201
CodecCodeForBlock signals that the associated buffer was created from plan.Block.Marshal()
const CodecCodeForEntryCrypt = 0x0202
CodecCodeForEntryCrypt signals that the associated buffer was created from pdi.EntryCrypt.Marshal()
Variables ¶
var ( // BinEncoding is used to encode/decode binary bufs in PLAN. BinEncoding = base64.RawURLEncoding // GenesisMemberID is the genesis member ID GenesisMemberID = uint32(1) )
var ( ErrInvalidLengthPlan = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPlan = fmt.Errorf("proto: integer overflow") )
var ( // DefaultFileMode is used to express the default mode of file creation. DefaultFileMode = os.FileMode(0775) )
var NilTID = TIDBlob{
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
}
NilTID is a reserved TID that denotes a void/nil/zero value of a TID
var ServiceType_name = map[int32]string{
0: "Undefined",
1: "StorageProvider",
2: "Repo",
3: "WsHost",
4: "ServiceTracker",
}
var ServiceType_value = map[string]int32{
"Undefined": 0,
"StorageProvider": 1,
"Repo": 2,
"WsHost": 3,
"ServiceTracker": 4,
}
var ValType_name = map[int32]string{
0: "NONE",
1: "INT",
2: "FLOAT",
3: "STR",
4: "BLOCK",
}
var ValType_value = map[string]int32{
"NONE": 0,
"INT": 1,
"FLOAT": 2,
"STR": 3,
"BLOCK": 4,
}
Functions ¶
func CreateNewDir ¶
CreateNewDir creates the specified dir (and returns an error if the dir already exists)
If inPath is absolute then inBasePath is ignored. Returns the effective pathname.
func MakeFSFriendly ¶
MakeFSFriendly makes a given string safe to use for a file system. If inSuffix is given, the hex encoding of those bytes are appended after a space.
func SetupBaseDir ¶
SetupBaseDir parses/expands inLocalPath and then verifies it's existence or non-existence, depending on inCreate and returning the the expanded path.
If inCreate == true, an error is returned if the dir exists or failed to be created.
If inCreate == false, an error is returned if the die doesn't exist.
Types ¶
type Block ¶
type Block struct { // An optional, name/label for this Block (i.e. a field-name). // A Block's label conforms to the context/protocol it's being used with (as applicable). Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` // Similar to a MIME type, this descriptor self-describes the data format of Block.content. // Anyone handed this Block uses this field to accurately process/deserialize its content. // This is a "multicodec path" -- see: https://github.com/multiformats/multistream Codec string `protobuf:"bytes,2,opt,name=codec,proto3" json:"codec,omitempty"` // This is a reserved integer alternative to Block.Codec. // See: https://github.com/plan-systems/multicodec/blob/master/table.csv CodecCode uint32 `protobuf:"varint,3,opt,name=codec_code,json=codecCode,proto3" json:"codec_code,omitempty"` // Payload data, serialized in accordance with the accompanying codec descriptors (above). Content []byte `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` ContentStr string `protobuf:"bytes,5,opt,name=content_str,json=contentStr,proto3" json:"content_str,omitempty"` // A Block can optionally contain nested "sub" blocks. A Block's sub-blocks // can be interpreted or employed any way a client or protocol sees fit. Subs []*Block `protobuf:"bytes,10,rep,name=subs,proto3" json:"subs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Block is a portable, compact, self-describing, nestable information container inspired from HTTP.
func (*Block) AddContentWithCodec ¶
AddContentWithCodec appends a new block with the given content buf an accompanying multicodec path
func (*Block) AddContentWithLabel ¶
AddContentWithLabel appends a new block with the given label and content
func (*Block) Descriptor ¶
func (*Block) GetBlockWithCodec ¶
GetBlockWithCodec returns the first-appearing Block with a matching codec string (self and shallow search only)
func (*Block) GetBlockWithLabel ¶
GetBlockWithLabel returns the first-appearing Block with a matching block label -- see GetBlocksWithLabel()
func (*Block) GetBlocksWithCodec ¶
GetBlocksWithCodec returns all Blocks with a matching codec string (SearchBlocksSelf + SearchBlocksShallow)
func (*Block) GetBlocksWithLabel ¶
GetBlocksWithLabel returns all Blocks with a matching block label (SearchBlocksSelf + SearchBlocksShallow)
func (*Block) GetCodecCode ¶
func (*Block) GetContent ¶
func (*Block) GetContentStr ¶
func (*Block) GetContentWithCodec ¶
GetContentWithCodec returns the content of the first-appearing Block with a matching label/name
func (*Block) GetContentWithLabel ¶
GetContentWithLabel returns the content of the first-appearing Block with a matching label/name
func (*Block) InvokeBlocksWithCodec ¶
func (block *Block) InvokeBlocksWithCodec( inCodec string, inCodecCode uint32, inCallback func(inMatch *Block) error, ) error
InvokeBlocksWithCodec performs a self and shallow search for matching Blocks. If an error is encountered, iteration stops and the error is returned.
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) XXX_DiscardUnknown ¶
func (m *Block) XXX_DiscardUnknown()
func (*Block) XXX_Marshal ¶
func (*Block) XXX_Unmarshal ¶
type BlockSearchScope ¶
type BlockSearchScope int
BlockSearchScope specifies what parts of a Block to search for matches. The GetBlock*() calls below that don't accept a BlockSearchScope parameter implicitly use:
SearchBlocksSelf + SearchBlocksShallow
const ( // SearchBlocksSelf means the root block is analyzed as a possible match. SearchBlocksSelf BlockSearchScope = 1 + iota // SearchBlocksShallow searches the "subs" part of the given target but no more SearchBlocksShallow // SearchBlocksDepthFirst searches into each sub-Block recursively. SearchBlocksDepthFirst )
type ChID ¶
type ChID []byte
ChID identifies a PLAN channel.
func (ChID) Blob ¶
Blob is a convenience function that forms a ChID byte array from a ChID byte slice.
type ChInvocation ¶
type ChInvocation struct { ChID []byte `protobuf:"bytes,1,opt,name=chID,proto3" json:"chID,omitempty"` ChProtocol string `protobuf:"bytes,2,opt,name=ch_protocol,json=chProtocol,proto3" json:"ch_protocol,omitempty"` ChAdapterID string `protobuf:"bytes,3,opt,name=ch_adapterID,json=chAdapterID,proto3" json:"ch_adapterID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ChInvocation) Descriptor ¶
func (*ChInvocation) Descriptor() ([]byte, []int)
func (*ChInvocation) GetChAdapterID ¶
func (m *ChInvocation) GetChAdapterID() string
func (*ChInvocation) GetChID ¶
func (m *ChInvocation) GetChID() []byte
func (*ChInvocation) GetChProtocol ¶
func (m *ChInvocation) GetChProtocol() string
func (*ChInvocation) Marshal ¶
func (m *ChInvocation) Marshal() (dAtA []byte, err error)
func (*ChInvocation) ProtoMessage ¶
func (*ChInvocation) ProtoMessage()
func (*ChInvocation) Reset ¶
func (m *ChInvocation) Reset()
func (*ChInvocation) Size ¶
func (m *ChInvocation) Size() (n int)
func (*ChInvocation) String ¶
func (m *ChInvocation) String() string
func (*ChInvocation) Unmarshal ¶
func (m *ChInvocation) Unmarshal(dAtA []byte) error
func (*ChInvocation) XXX_DiscardUnknown ¶
func (m *ChInvocation) XXX_DiscardUnknown()
func (*ChInvocation) XXX_Marshal ¶
func (m *ChInvocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ChInvocation) XXX_Merge ¶
func (m *ChInvocation) XXX_Merge(src proto.Message)
func (*ChInvocation) XXX_Size ¶
func (m *ChInvocation) XXX_Size() int
func (*ChInvocation) XXX_Unmarshal ¶
func (m *ChInvocation) XXX_Unmarshal(b []byte) error
type CommunityID ¶
type CommunityID [CommunityIDSz]byte
CommunityID identifies a PLAN community and is randomly generated during its genesis.
func GetCommunityID ¶
func GetCommunityID(in []byte) CommunityID
GetCommunityID returns the CommunityID for the given buffer
type Err ¶
Err is PLAN's common error struct. Err.Code allows easy matching while allowing error strings to contain useful contextual information.
type Link ¶
type Link struct { // THis is an optional label that describes this link or serves as an identifying key (and is follows a naming convention so this link can be identified by label) // This value is typically not seen by humans. Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` // This describes this link in a meaningful way Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` // See docs on PLAN URIs (above) URI string `protobuf:"bytes,3,opt,name=URI,proto3" json:"URI,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Link is an opaque URI most comparable to a URL, but it's "multiaddr" style, rather than protocol://URI.
func (*Link) Descriptor ¶
func (*Link) ProtoMessage ¶
func (*Link) ProtoMessage()
func (*Link) XXX_DiscardUnknown ¶
func (m *Link) XXX_DiscardUnknown()
func (*Link) XXX_Unmarshal ¶
type MemberAlias ¶
type MemberAlias string
MemberAlias is a self-given community member name and is how they are seen by humans in the community,
making it a convenience tool for humans to easily refer to other members.
A member can change their MemberAlias at any time (though there may be reasonable restrictions in place). Note: a MemberID is generated from the right-most bytes of the SHA256 hash of the community ID concatenated
with the member's first chosen alias (or an alternatively entered "member ID generation phrase"). This scheme makes the member ID recoverable from human memory, even if there is no network access.
type MemberID ¶
type MemberID uint32
MemberID identifies a member within a given community and never changes -- even when a member initiates
a new "epoch" so their crypto can be regenerated.
Member IDs are considered collision-proof since inside a community, they must be cleared through
the community's new member registration process (which will reject a collision).
type Multicodec ¶
type Multicodec uint32
Multicodec is a compact way of specifying a binary format -- see https://github.com/plan-systems/multicodec
const ( UnspecifiedCodec Multicodec = 0 TxnSegmentCodec Multicodec = 0x3050 TxnInfoCodec Multicodec = 0x3051 SigHeaderCodec Multicodec = 0x3052 EntryCryptCodec Multicodec = 0x3053 EntryInfoCodec Multicodec = 0x3054 BlockCodec Multicodec = 0x3055 LinkCodec Multicodec = 0x3056 URICodec Multicodec = 0x3057 )
Multicodec standard values used in PLAN. See https://github.com/plan-systems/multicodec/blob/master/table.csv
type ServiceInfo ¶
type ServiceInfo struct { ServiceType ServiceType `protobuf:"varint,1,opt,name=service_type,json=serviceType,proto3,enum=plan.ServiceType" json:"service_type,omitempty"` NameID string `protobuf:"bytes,2,opt,name=nameID,proto3" json:"nameID,omitempty"` NodeID []byte `protobuf:"bytes,3,opt,name=nodeID,proto3" json:"nodeID,omitempty"` Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` Addr string `protobuf:"bytes,10,opt,name=addr,proto3" json:"addr,omitempty"` Network string `protobuf:"bytes,11,opt,name=network,proto3" json:"network,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
ServiceInfo contains descriptions, network addresses, ports, and connection info for remote services.
func (*ServiceInfo) Descriptor ¶
func (*ServiceInfo) Descriptor() ([]byte, []int)
func (*ServiceInfo) GetAddr ¶
func (m *ServiceInfo) GetAddr() string
func (*ServiceInfo) GetDesc ¶
func (m *ServiceInfo) GetDesc() string
func (*ServiceInfo) GetNameID ¶
func (m *ServiceInfo) GetNameID() string
func (*ServiceInfo) GetNetwork ¶
func (m *ServiceInfo) GetNetwork() string
func (*ServiceInfo) GetNodeID ¶
func (m *ServiceInfo) GetNodeID() []byte
func (*ServiceInfo) GetServiceType ¶
func (m *ServiceInfo) GetServiceType() ServiceType
func (*ServiceInfo) Marshal ¶
func (m *ServiceInfo) Marshal() (dAtA []byte, err error)
func (*ServiceInfo) ProtoMessage ¶
func (*ServiceInfo) ProtoMessage()
func (*ServiceInfo) Reset ¶
func (m *ServiceInfo) Reset()
func (*ServiceInfo) Size ¶
func (m *ServiceInfo) Size() (n int)
func (*ServiceInfo) String ¶
func (m *ServiceInfo) String() string
func (*ServiceInfo) Unmarshal ¶
func (m *ServiceInfo) Unmarshal(dAtA []byte) error
func (*ServiceInfo) XXX_DiscardUnknown ¶
func (m *ServiceInfo) XXX_DiscardUnknown()
func (*ServiceInfo) XXX_Marshal ¶
func (m *ServiceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ServiceInfo) XXX_Merge ¶
func (m *ServiceInfo) XXX_Merge(src proto.Message)
func (*ServiceInfo) XXX_Size ¶
func (m *ServiceInfo) XXX_Size() int
func (*ServiceInfo) XXX_Unmarshal ¶
func (m *ServiceInfo) XXX_Unmarshal(b []byte) error
type ServiceType ¶
type ServiceType int32
const ( ServiceType_Undefined ServiceType = 0 ServiceType_StorageProvider ServiceType = 1 ServiceType_Repo ServiceType = 2 ServiceType_WsHost ServiceType = 3 ServiceType_ServiceTracker ServiceType = 4 )
func (ServiceType) EnumDescriptor ¶
func (ServiceType) EnumDescriptor() ([]byte, []int)
func (ServiceType) String ¶
func (x ServiceType) String() string
type Status ¶
type Status struct { // Information code Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // Information msg Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // An unordered list of arbitrary fields/params associated with this error Params []*Val `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Status) Descriptor ¶
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) XXX_DiscardUnknown ¶
func (m *Status) XXX_DiscardUnknown()
func (*Status) XXX_Marshal ¶
func (*Status) XXX_Unmarshal ¶
type StorageID ¶
type StorageID uint16
StorageID identifies a storage instance within a given community.
When a storage network/provider is created to host a given community, it is identified from other (previous) instances by ensuring that the newly assigned StorageID is unique in community's history, something trivially done by the person(s) leading the storage switchover. In the lifetime of a community, there would only need to be a new StorageID generated when the community moved to a new storage provider/network.
type TID ¶
type TID []byte
TID identifies a specific PLAN channel, channel entry, or anything else labeled via plan.GenerateIID()
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) ExtractChID ¶
ExtractChID returns the ChID for what is presumed to be a channel genesis entry (whose ChID is dervied from the EntryID)
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) PrefixStr ¶
PrefixStr returns the left-hand part of this TID as plan.Base64 (typically used to visually inspect the timestamp of this TID)
func (TID) SelectEarlier ¶
SelectEarlier looks in inTime a chooses whichever is earlier.
If inTime is later than the time embedded in this TID, then this function has no effect and returns false.
If inTime is earlier, then this TID is initialized to inTime (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 plan.TIDSz
type TimeFS ¶
type TimeFS int64
TimeFS is the UTC in 1/1<<16 seconds elapsed since Jan 1, 1970 UTC ("FS" = fractional seconds)
Shifting this right 16 bits will yield stanard Unix time. This means there are 47 bits dedicated for seconds, implying max timestamp of 4.4 million years.
Note: if a precision deeper than one seconds is not available or n/a, then the best available precision should be used (or 0).
type Val ¶
type Val struct { // The value's name/label/key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Specifies which of the below are set/valid ValType ValType `protobuf:"varint,2,opt,name=val_type,json=valType,proto3,enum=plan.ValType" json:"val_type,omitempty"` Int int64 `protobuf:"varint,3,opt,name=int,proto3" json:"int,omitempty"` Float float64 `protobuf:"fixed64,4,opt,name=float,proto3" json:"float,omitempty"` Str string `protobuf:"bytes,5,opt,name=str,proto3" json:"str,omitempty"` Block *Block `protobuf:"bytes,6,opt,name=block,proto3" json:"block,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Val) Descriptor ¶
func (*Val) GetValType ¶
func (*Val) ProtoMessage ¶
func (*Val) ProtoMessage()
func (*Val) XXX_DiscardUnknown ¶
func (m *Val) XXX_DiscardUnknown()