utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidIdentifier = "fb53dd05-329b-4614-a3f2-c0a8c7554ee3"
	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 IsValidV1ID added in v1.3.0

func IsValidV1ID(id string) bool

func LoadConfig

func LoadConfig() (types.Config, error)

func MigrateIndyStyleDid added in v1.3.0

func MigrateIndyStyleDid(did string) string

func MigrateIndyStyleId added in v1.3.0

func MigrateIndyStyleId(id string) string

func MigrateUUIDDid added in v1.3.0

func MigrateUUIDDid(did string) string

func MigrateUUIDId added in v1.3.0

func MigrateUUIDId(id string) string

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() didTypes.DidDoc

func ValidMetadata added in v1.2.0

func ValidMetadata() didTypes.Metadata

func ValidResource added in v1.2.0

func ValidResource() resource.ResourceWithMetadata

func ValidService added in v1.2.0

func ValidService() didTypes.Service

func ValidVerificationMethod added in v1.2.0

func ValidVerificationMethod() didTypes.VerificationMethod

func ValidateV1ID added in v1.3.0

func ValidateV1ID(id string) error

Types

type MockLedgerService added in v1.2.0

type MockLedgerService struct {
	Did      didTypes.DidDoc
	Metadata didTypes.Metadata
	Resource resource.ResourceWithMetadata
}

func NewMockLedgerService added in v1.2.0

func NewMockLedgerService(did didTypes.DidDoc, metadata didTypes.Metadata, resource resource.ResourceWithMetadata) 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.Metadata, *types.IdentityError)

func (MockLedgerService) QueryDIDDoc added in v1.2.0

func (ls MockLedgerService) QueryDIDDoc(did string, version string) (*didTypes.DidDocWithMetadata, *types.IdentityError)

func (MockLedgerService) QueryResource added in v1.2.0

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

Jump to

Keyboard shortcuts

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