utils

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidIdentifier = "N22KY2Dyvmuu2Pyy"
	ValidMethod     = "cheqd"
	ValidNamespace  = "mainnet"
	ValidDid        = "did:" + ValidMethod + ":" + ValidNamespace + ":" + ValidIdentifier
	ValidResourceId = "a09abea0-22e0-4b35-8f70-9cc3a6d0b5fd"
	ValidPubKeyJWK  = "{" +
		"\"crv\":\"Ed25519\"," +
		"\"kid\":\"_Qq0UL2Fq651Q0Fjd6TvnYE-faHiOpRlPVQcY_-tA4A\"," +
		"\"kty\":\"OKP\"," +
		"\"x\":\"VCpo2LMLhn6iWku8MKvSLg2ZAoC-nlOyPVQaO3FxVeQ\"" +
		"}"
)

Variables

View Source
var ResourceId, _ = regexp.Compile(`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`)

Functions

func IsDidUrl added in v1.2.0

func IsDidUrl(didUrl string) bool

func IsValidResourceId added in v1.2.0

func IsValidResourceId(u string) bool

func LoadConfig

func LoadConfig() (types.Config, error)

func MustLoadConfig

func MustLoadConfig() types.Config

func NewConfig added in v1.2.0

func NewConfig(rawConfig types.RawConfig) (types.Config, error)

func ParseGRPCEndpoint added in v1.2.0

func ParseGRPCEndpoint(configEndpoint string, networkName string) (*types.Network, error)

func ValidDIDDoc added in v1.2.0

func ValidDIDDoc() cheqd.Did

func ValidMetadata added in v1.2.0

func ValidMetadata() cheqd.Metadata

func ValidResource added in v1.2.0

func ValidResource() resource.Resource

func ValidService added in v1.2.0

func ValidService() cheqd.Service

func ValidVerificationMethod added in v1.2.0

func ValidVerificationMethod() cheqd.VerificationMethod

Types

type MockLedgerService added in v1.2.0

type MockLedgerService struct {
	Did      cheqd.Did
	Metadata cheqd.Metadata
	Resource resource.Resource
}

func NewMockLedgerService added in v1.2.0

func NewMockLedgerService(did cheqd.Did, metadata cheqd.Metadata, resource resource.Resource) MockLedgerService

func (MockLedgerService) GetNamespaces added in v1.2.0

func (ls MockLedgerService) GetNamespaces() []string

func (MockLedgerService) QueryCollectionResources added in v1.2.0

func (ls MockLedgerService) QueryCollectionResources(did string) ([]*resource.ResourceHeader, *types.IdentityError)

func (MockLedgerService) QueryDIDDoc added in v1.2.0

func (ls MockLedgerService) QueryDIDDoc(did string) (*cheqd.Did, *cheqd.Metadata, *types.IdentityError)

func (MockLedgerService) QueryResource added in v1.2.0

func (ls MockLedgerService) QueryResource(did string, resourceId string) (*resource.Resource, *types.IdentityError)

Jump to

Keyboard shortcuts

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