Documentation
¶
Overview ¶
Package dataverse provides programmatic access to the Axone protocol, it carries the high level logic to interacts with its components hiding the low level details.
Index ¶
Constants ¶
View Source
const W3IDPrefix = "https://w3id.org/axone/ontology/v4"
Variables ¶
Functions ¶
func NewDVError ¶
func NewDVError(message MessageError, detail error) error
Types ¶
type LawStoneFactory ¶
type LawStoneFactory func(string) (lsschema.QueryClient, error)
type MessageError ¶
type MessageError string
const ( ErrNoResult MessageError = "no result found in binding" ErrVarNotFound MessageError = "variable not found in binding result" ErrType MessageError = "variable result type mismatch in binding result" ErrConvertRDF MessageError = "could not convert credential to RDF" ErrMarshalJSON MessageError = "could not marshal JSON message" ErrSendTx MessageError = "could not send transaction" )
type QueryClient ¶
type QueryClient interface {
// GetResourceGovAddr returns the governance address of a resource.
// It queries the cognitarium to get the governance address (law-stone contract address)
// of a resource. The resource is identified by its DID.
GetResourceGovAddr(context.Context, string) (string, error)
// AskGovPermittedActions returns the permitted actions for a resource identified by its DID.
// It queries the law-stone contract to get the permitted actions for a resource using the following predicate:
// “`prolog
// tell_permitted_actions(DID, Actions).
// “`
AskGovPermittedActions(context.Context, string, string) ([]string, error)
// AskGovTellAction queries the law-stone contract to check if a given action is permitted for a resource.
// It uses the following predicate:
// “`prolog
// tell(DID, Action, Result, Evidence).
// “`
// The function returns true if Result is 'permitted', false otherwise.
AskGovTellAction(context.Context, string, string, string) (bool, error)
// GovCode retrieves the governance code given its address (law-stone contract address)
GovCode(context.Context, string) (string, error)
}
func NewQueryClient ¶
func NewQueryClient( ctx context.Context, grpcAddr, contractAddr string, opts ...grpc.DialOption, ) (QueryClient, error)
type TxClient ¶
type TxClient interface {
// SubmitClaims submits a verifiable credential to the dataverse contract.
// Credential must be signed to be submitted.
SubmitClaims(ctx context.Context, credential *verifiable.Credential) (*types.TxResponse, error)
}
Click to show internal directories.
Click to hide internal directories.