entity

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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

This section is empty.

Functions

func ListOfNetworks

func ListOfNetworks() networks

func MapRecordsToProto

func MapRecordsToProto(records []Record) []*proto.Record

func NetworkToProto added in v2.2.0

func NetworkToProto(network Network) *proto.Network

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

func NewAnchorFromProto(a *proto.Anchor) Anchor

type AnchorNetwork

type AnchorNetwork struct {
	Name   string
	State  string
	TxHash string
}

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 Decrypter

type Decrypter interface {
	ToProto() *proto.Decrypter
}

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 Encrypter

type Encrypter interface {
	ToProto() *proto.Encrypter
}

type EncrypterArgs

type EncrypterArgs struct {
	Key string
}

func (EncrypterArgs) ToProto

func (e EncrypterArgs) ToProto() *proto.EncrypterArgs

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

type KeyPair struct {
	PublicKey  string
	PrivateKey string
}

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 Loader

type Loader interface {
	ToProto() *proto.Loader
}

type LoaderArgs

type LoaderArgs struct {
	// contains filtered or unexported fields
}

func (LoaderArgs) ToProto

func (e LoaderArgs) ToProto() *proto.LoaderArgs

type Network

type Network = proto.Network

type NetworkConfig

type NetworkConfig struct {
	ContractAddress string
	ContractAbi     string
	HttpProvider    string
}

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

func NewProofFromProto(p *proto.Proof) Proof

func (Proof) ToProto

func (p Proof) ToProto() *proto.Proof

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 Publisher

type Publisher interface {
	ToProto() *proto.Publisher
}

type PublisherArgs

type PublisherArgs struct {
}

func (PublisherArgs) ToProto

func (e PublisherArgs) ToProto() *proto.PublisherArgs

type Record

type Record struct {
	Payload []byte
}

func NewRecordFromProto

func NewRecordFromProto(r *proto.Record) Record

func (*Record) GetHash

func (r *Record) GetHash() (string, error)

func (*Record) GetSignatures

func (r *Record) GetSignatures() ([]Signature, error)

func (*Record) Publish

func (r *Record) Publish(p Publisher) (string, error)

func (*Record) Retrieve

func (r *Record) Retrieve() []byte

func (*Record) SetProof added in v2.1.0

func (r *Record) SetProof(proof Proof) error

func (*Record) ToProto

func (r *Record) ToProto() *proto.Record

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

type RecordReceipt struct {
	Anchor int64
	Client string
	Record string
	Status string
}

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 NewSignatureFromProto(s *proto.Signature) Signature

func (*Signature) GetCommonName added in v2.1.4

func (s *Signature) GetCommonName() (string, error)

func (Signature) ToProto

func (s Signature) ToProto() *proto.Signature

type SignatureHeader

type SignatureHeader struct {
	Alg string
	Kid string
}

func NewSignatureHeaderFromProto

func NewSignatureHeaderFromProto(s *proto.SignatureHeader) SignatureHeader

func (SignatureHeader) ToProto

func (s SignatureHeader) ToProto() *proto.SignatureHeader

type Signer

type Signer interface {
	ToProto() *proto.Signer
}

type SignerArgs

type SignerArgs struct {
	PrivateKey string
	CommonName *string
}

func (SignerArgs) ToProto

func (s SignerArgs) ToProto() *proto.SignerArgs

Jump to

Keyboard shortcuts

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