Documentation
¶
Index ¶
- Constants
- Variables
- func ListOfNetworks() networks
- func MapRecordsToProto(records []Record) []*proto.Record
- func NetworkToProto(network Network) *proto.Network
- type AesDecrypter
- type AesEncrypter
- type Anchor
- type AnchorNetwork
- type AnchorParams
- type Decrypter
- type DecrypterArgs
- type EcdsaSigner
- type EciesDecrypter
- type EciesEncrypter
- type Encrypter
- type EncrypterArgs
- type EncryptionAlg
- type HostedLoader
- type HostedPublisher
- type IpfsLoader
- type IpfsPublisher
- type KeyPair
- type Loader
- type LoaderArgs
- type Network
- type NetworkConfig
- type NetworkParams
- type Proof
- type ProofAnchor
- type Publisher
- type PublisherArgs
- type Record
- func (r *Record) GetEncryptionAlg() (EncryptionAlg, error)
- func (r *Record) GetHash() (string, error)
- func (r *Record) GetSignatures() ([]Signature, error)
- func (r *Record) Publish(p Publisher) (string, error)
- func (r *Record) Retrieve() []byte
- func (r *Record) SetProof(proof Proof) error
- func (r *Record) ToProto() *proto.Record
- type RecordHeader
- type RecordReceipt
- type RsaDecrypter
- type RsaEncrypter
- type Signature
- type SignatureAlg
- type SignatureHeader
- type Signer
- type SignerArgs
Constants ¶
View Source
const ( InvalidRecordError = "Record error: Invalid record" RecordNotFoundError = "Infrastructure error: Http Client error: Request error - API connected by HttpClient found an error: record not found" WaitAnchorTimeoutError = "Anchor error: Wait Anchor timed out" AnchorNotFoundError = "Infrastructure error: Http Client error: API connected by HttpClient found an error: anchor not found" )
Variables ¶
View Source
var ( EncryptionAlgFromProto = map[proto.EncryptionAlg]EncryptionAlg{ 0: AES256GCM, 1: RSA, 2: ECIES, } EncryptionAlgToProto = map[EncryptionAlg]proto.EncryptionAlg{ AES256GCM: 0, RSA: 1, ECIES: 2, } )
View Source
var ( SignatureAlgFromProto = map[string]SignatureAlg{ "ES256K": ECDSA, } )
Functions ¶
func ListOfNetworks ¶
func ListOfNetworks() networks
func MapRecordsToProto ¶
func NetworkToProto ¶ added in v2.2.0
Types ¶
type AesDecrypter ¶
type AesDecrypter struct { Alg proto.EncryptionAlg Args DecrypterArgs }
func NewAesDecrypter ¶
func NewAesDecrypter(password string) AesDecrypter
func (AesDecrypter) ToProto ¶
func (e AesDecrypter) ToProto() *proto.Decrypter
type AesEncrypter ¶
type AesEncrypter struct { Alg proto.EncryptionAlg Args EncrypterArgs }
func NewAesEncrypter ¶
func NewAesEncrypter(password string) AesEncrypter
func (AesEncrypter) ToProto ¶
func (e AesEncrypter) ToProto() *proto.Encrypter
type Anchor ¶
type Anchor struct { Id int64 BlockRoots []string Networks []AnchorNetwork Root string Status string }
func NewAnchorFromProto ¶
type AnchorNetwork ¶
func MapAnchorNetworksFromProto ¶
func MapAnchorNetworksFromProto(n []*proto.AnchorNetwork) []AnchorNetwork
func NewAnchorNetworkFromProto ¶
func NewAnchorNetworkFromProto(a *proto.AnchorNetwork) AnchorNetwork
func (AnchorNetwork) ToProto ¶
func (a AnchorNetwork) ToProto() *proto.AnchorNetwork
type AnchorParams ¶
type AnchorParams struct {
Timeout int64
}
func NewAnchorParams ¶
func NewAnchorParams() AnchorParams
type DecrypterArgs ¶
type DecrypterArgs struct {
Key string
}
func (DecrypterArgs) ToProto ¶
func (e DecrypterArgs) ToProto() *proto.DecrypterArgs
type EcdsaSigner ¶ added in v2.2.0
type EcdsaSigner struct { Alg proto.SignerAlg Args SignerArgs }
func NewEcdsaSigner ¶ added in v2.2.0
func NewEcdsaSigner(args SignerArgs) EcdsaSigner
func (EcdsaSigner) ToProto ¶ added in v2.2.0
func (s EcdsaSigner) ToProto() *proto.Signer
type EciesDecrypter ¶ added in v2.0.2
type EciesDecrypter struct { Alg proto.EncryptionAlg Args DecrypterArgs }
func (EciesDecrypter) ToProto ¶ added in v2.0.2
func (e EciesDecrypter) ToProto() *proto.Decrypter
type EciesEncrypter ¶ added in v2.0.2
type EciesEncrypter struct { Alg proto.EncryptionAlg Args EncrypterArgs }
func (EciesEncrypter) ToProto ¶ added in v2.0.2
func (e EciesEncrypter) ToProto() *proto.Encrypter
type EncrypterArgs ¶
type EncrypterArgs struct {
Key string
}
func (EncrypterArgs) ToProto ¶
func (e EncrypterArgs) ToProto() *proto.EncrypterArgs
type EncryptionAlg ¶ added in v2.3.0
type EncryptionAlg int32
const ( AES256GCM EncryptionAlg = iota RSA EncryptionAlg = iota ECIES EncryptionAlg = iota UNRECOGNIZED_ENCRYPTION_ALG EncryptionAlg = -1 )
type HostedLoader ¶
type HostedLoader struct { Type proto.DataAvailabilityType Args LoaderArgs }
func NewHostedLoader ¶
func NewHostedLoader(hash string) HostedLoader
func (HostedLoader) ToProto ¶
func (e HostedLoader) ToProto() *proto.Loader
type HostedPublisher ¶
type HostedPublisher struct { Type proto.DataAvailabilityType Args PublisherArgs }
func NewHostedPublisher ¶
func NewHostedPublisher() HostedPublisher
func (HostedPublisher) ToProto ¶
func (e HostedPublisher) ToProto() *proto.Publisher
type IpfsLoader ¶ added in v2.1.4
type IpfsLoader struct { Type proto.DataAvailabilityType Args LoaderArgs }
func NewIpfsLoader ¶ added in v2.1.4
func NewIpfsLoader(hash string) IpfsLoader
func (IpfsLoader) ToProto ¶ added in v2.1.4
func (e IpfsLoader) ToProto() *proto.Loader
type IpfsPublisher ¶ added in v2.1.4
type IpfsPublisher struct { Type proto.DataAvailabilityType Args PublisherArgs }
func NewIpfsPublisher ¶ added in v2.1.4
func NewIpfsPublisher() IpfsPublisher
func (IpfsPublisher) ToProto ¶ added in v2.1.4
func (e IpfsPublisher) ToProto() *proto.Publisher
type KeyPair ¶ added in v2.0.2
func NewEciesKeyPairFromProto ¶ added in v2.0.2
func NewEciesKeyPairFromProto(k *proto.GenerateEciesKeyPairResponse) KeyPair
func NewKeysFromProto ¶
func NewKeysFromProto(k *proto.GenerateKeysResponse) KeyPair
func NewRsaKeyPairFromProto ¶ added in v2.0.2
func NewRsaKeyPairFromProto(k *proto.GenerateRsaKeyPairResponse) KeyPair
type LoaderArgs ¶
type LoaderArgs struct {
// contains filtered or unexported fields
}
func (LoaderArgs) ToProto ¶
func (e LoaderArgs) ToProto() *proto.LoaderArgs
type NetworkConfig ¶
type NetworkParams ¶
type NetworkParams struct {
Network Network
}
func NewNetworkParams ¶
func NewNetworkParams() NetworkParams
type Proof ¶
type Proof struct { Leaves []string Nodes []string Depth string Bitmap string Anchor ProofAnchor }
func NewProofFromProto ¶
type ProofAnchor ¶
type ProofAnchor struct { AnchorID int64 Networks []AnchorNetwork Root string Status string }
func NewProofAnchorFromProto ¶
func NewProofAnchorFromProto(p *proto.ProofAnchor) ProofAnchor
func (ProofAnchor) ToProto ¶
func (p ProofAnchor) ToProto() *proto.ProofAnchor
type PublisherArgs ¶
type PublisherArgs struct { }
func (PublisherArgs) ToProto ¶
func (e PublisherArgs) ToProto() *proto.PublisherArgs
type Record ¶
type Record struct { Payload []byte // contains filtered or unexported fields }
func NewRecordFromProto ¶
func (*Record) GetEncryptionAlg ¶ added in v2.3.0
func (r *Record) GetEncryptionAlg() (EncryptionAlg, error)
func (*Record) GetSignatures ¶
type RecordHeader ¶
type RecordHeader struct {
Ty string
}
func NewRecordHeaderFromProto ¶
func NewRecordHeaderFromProto(r *proto.RecordHeader) RecordHeader
func (RecordHeader) ToProto ¶
func (rh RecordHeader) ToProto() *proto.RecordHeader
type RecordReceipt ¶
func NewRecordReceiptFromProto ¶
func NewRecordReceiptFromProto(r *proto.RecordReceipt) RecordReceipt
type RsaDecrypter ¶ added in v2.0.2
type RsaDecrypter struct { Alg proto.EncryptionAlg Args DecrypterArgs }
func NewEciesDecrypter ¶ added in v2.0.2
func NewEciesDecrypter(key string) RsaDecrypter
func NewRsaDecrypter ¶ added in v2.0.2
func NewRsaDecrypter(key string) RsaDecrypter
func (RsaDecrypter) ToProto ¶ added in v2.0.2
func (e RsaDecrypter) ToProto() *proto.Decrypter
type RsaEncrypter ¶ added in v2.0.2
type RsaEncrypter struct { Alg proto.EncryptionAlg Args EncrypterArgs }
func NewEciesEncrypter ¶ added in v2.0.2
func NewEciesEncrypter(key string) RsaEncrypter
func NewRsaEncrypter ¶ added in v2.0.2
func NewRsaEncrypter(key string) RsaEncrypter
func (RsaEncrypter) ToProto ¶ added in v2.0.2
func (e RsaEncrypter) ToProto() *proto.Encrypter
type Signature ¶
type Signature struct { Signature string Protected string Header SignatureHeader }
func NewSignatureFromProto ¶
func (*Signature) GetAlg ¶ added in v2.3.0
func (s *Signature) GetAlg() SignatureAlg
func (*Signature) GetCommonName ¶ added in v2.1.4
type SignatureAlg ¶ added in v2.3.0
type SignatureAlg int32
const ( ECDSA SignatureAlg = iota UNRECOGNIZED_SIGNATURE_ALG SignatureAlg = -1 )
type SignatureHeader ¶
func NewSignatureHeaderFromProto ¶
func NewSignatureHeaderFromProto(s *proto.SignatureHeader) SignatureHeader
func (SignatureHeader) ToProto ¶
func (s SignatureHeader) ToProto() *proto.SignatureHeader
type SignerArgs ¶
func (SignerArgs) ToProto ¶
func (s SignerArgs) ToProto() *proto.SignerArgs
Click to show internal directories.
Click to hide internal directories.