Documentation ¶
Overview ¶
Package api defines gomobile-compatible wallet-sdk interfaces.
Index ¶
- func StringArrayArrayToGoArray(arrayArray *StringArrayArray) [][]string
- type Activity
- type ActivityLogger
- type Crypto
- type DIDDocResolution
- type DIDResolver
- type Header
- type Headers
- type JSONWebKey
- type JSONWebKeySet
- type KeyValuePair
- type KeyValuePairs
- type LDDocument
- type LDDocumentLoader
- type MetricsEvent
- type MetricsLogger
- type Params
- type Signer
- type StringArray
- type StringArrayArray
- type VerificationMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StringArrayArrayToGoArray ¶
func StringArrayArrayToGoArray(arrayArray *StringArrayArray) [][]string
StringArrayArrayToGoArray converts StringArrayArray to [][]string.
Types ¶
type Activity ¶
type Activity struct { // GoAPIActivity will not be accessible directly in the bindings (will be "skipped"). // This is OK - this field is not intended to be set directly by the user of the SDK. GoAPIActivity *goapi.Activity }
An Activity represents a single activity.
func ParseActivity ¶
ParseActivity parses the given serialized activity and returns an Activity object.
func (*Activity) Client ¶
Client returns information about with whom this activity was with. For example: the issuer name, verifier name, etc.
func (*Activity) Operation ¶
Operation returns what operation was performed. For example: oidc-issuance, oidc-presentation, etc.
func (*Activity) Status ¶
Status returns the status of the operation that was performed. For example: success, failure, etc.
func (*Activity) UnixTimestamp ¶
UnixTimestamp returns the time this activity happened as a Unix timestamp.
type ActivityLogger ¶
An ActivityLogger logs activities.
type Crypto ¶
type Crypto interface { // Sign will sign msg using a matching signature primitive from key referenced by keyID // returns: // signature as []byte // error in case of errors Sign(msg []byte, keyID string) ([]byte, error) }
Crypto defines useful Crypto operations.
type DIDDocResolution ¶
type DIDDocResolution struct { // Content is the full marshalled DID doc resolution object. Content string }
DIDDocResolution represents a DID document resolution object.
func NewDIDDocResolution ¶
func NewDIDDocResolution(content string) *DIDDocResolution
NewDIDDocResolution creates a new DIDDocResolution.
func (*DIDDocResolution) AssertionMethod ¶
func (d *DIDDocResolution) AssertionMethod() (*VerificationMethod, error)
AssertionMethod returns did assertion verification method.
func (*DIDDocResolution) ID ¶
func (d *DIDDocResolution) ID() (string, error)
ID returns the ID of the DID document contained within this DIDDocResolution.
type DIDResolver ¶
type DIDResolver interface { // Resolve resolves a DID. It returns a DID document marshalled as JSON. Resolve(did string) ([]byte, error) }
DIDResolver defines the method required for a type to resolve DIDs.
type Headers ¶
type Headers struct {
// contains filtered or unexported fields
}
Headers represents an array of HTTP headers that can be used in certain APIs.
type JSONWebKey ¶
JSONWebKey holds a public key with associated metadata, in JWK format.
func ParseJSONWebKey ¶
func ParseJSONWebKey(data string) (*JSONWebKey, error)
ParseJSONWebKey parses a JSONWebKey from a JWK in JSON format.
func (*JSONWebKey) Serialize ¶
func (k *JSONWebKey) Serialize() (string, error)
Serialize returns a JSON representation of this JSONWebKey.
type JSONWebKeySet ¶
type JSONWebKeySet struct {
JWKs []JSONWebKey
}
JSONWebKeySet represents a JWK Set object.
func NewJSONWebKeySet ¶
func NewJSONWebKeySet() *JSONWebKeySet
NewJSONWebKeySet returns a new JSON Web Key Set. It acts as a gomobile-compatible wrapper around a Go array of JSONWebKey objects.
func (*JSONWebKeySet) Append ¶
func (j *JSONWebKeySet) Append(jsonWebKey *JSONWebKey) *JSONWebKeySet
Append appends the given JSONWebKey to the array. It returns a reference to the JSONWebKey in order to allow a caller to chain together Append calls.
func (*JSONWebKeySet) AtIndex ¶
func (j *JSONWebKeySet) AtIndex(index int) *JSONWebKey
AtIndex returns the JSONWebKey at the given index. If the index passed in is out of bounds, then nil is returned.
func (*JSONWebKeySet) Length ¶
func (j *JSONWebKeySet) Length() int
Length returns the number of JSONWebKeys contained within this JSONWebKeySet object.
type KeyValuePair ¶
type KeyValuePair struct {
// contains filtered or unexported fields
}
KeyValuePair represents a single key-value pair.
func (*KeyValuePair) Key ¶
func (k *KeyValuePair) Key() string
Key returns this key-value pair's key.
func (*KeyValuePair) ValueString ¶
func (k *KeyValuePair) ValueString() (string, error)
ValueString returns this key-value pair's value. If the value is not a string, then an error is returned.
func (*KeyValuePair) ValueStringArray ¶
func (k *KeyValuePair) ValueStringArray() (*StringArray, error)
ValueStringArray returns this key-value pair's value. If the value is not an array of strings, then an error is returned.
func (*KeyValuePair) ValueType ¶
func (k *KeyValuePair) ValueType() (string, error)
ValueType returns the type of this key-value pair's value. If value is a string, then "string" is returned. If value is an array of strings, then "[]string" is returned. No other types are (currently) supported - if the value is any other type then an error is returned.
type KeyValuePairs ¶
type KeyValuePairs struct {
// contains filtered or unexported fields
}
KeyValuePairs represents a set of key-value pairs.
func (*KeyValuePairs) AtIndex ¶
func (k *KeyValuePairs) AtIndex(index int) *KeyValuePair
AtIndex returns the key-value pair at the given index. If the index passed in is out of bounds, then nil is returned.
func (*KeyValuePairs) Length ¶
func (k *KeyValuePairs) Length() int
Length returns the number of key-value pairs contained within this KeyValuePairs object.
type LDDocument ¶
type LDDocument struct { DocumentURL string `json:"documentURL,omitempty"` Document string `json:"document,omitempty"` // Must be an LD document in JSON form. ContextURL string `json:"contextURL,omitempty"` }
LDDocument is linked domains document.
type LDDocumentLoader ¶
type LDDocumentLoader interface {
LoadDocument(url string) (*LDDocument, error)
}
LDDocumentLoader is capable of loading linked domains documents.
type MetricsEvent ¶
type MetricsEvent struct { // GoAPIMetricsEvent will not be accessible directly in the bindings (will be "skipped"). // This is OK - this field is not intended to be set directly by the user of the SDK. GoAPIMetricsEvent *goapi.MetricsEvent }
A MetricsEvent represents a single event that occurred that had performance metrics taken.
func (*MetricsEvent) DurationNanoseconds ¶
func (m *MetricsEvent) DurationNanoseconds() int64
DurationNanoseconds returns event duration as nanoseconds.
func (*MetricsEvent) ParentEvent ¶
func (m *MetricsEvent) ParentEvent() string
ParentEvent returns the parent event name.
type MetricsLogger ¶
type MetricsLogger interface {
Log(metricsEvent *MetricsEvent) error
}
MetricsLogger represents a type that can log MetricsEvents.
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
Params represents additional parameters which may be required for wallet applications in the future. As such, this is currently a placeholder.
func (*Params) AllKeyValuePairs ¶
func (p *Params) AllKeyValuePairs() *KeyValuePairs
AllKeyValuePairs returns all params as key-value pairs.
func (*Params) GetString ¶
GetString returns the value stored under the given key. If there is no param with that key, or if the param is not a string then an error is returned.
func (*Params) GetStringArray ¶
func (p *Params) GetStringArray(key string) (*StringArray, error)
GetStringArray returns the value stored under the given key. If there is no param with that key, or if the param is not an array of strings then an error is returned.
func (*Params) GetValueType ¶
GetValueType returns the type of the value stored under the given key. If there is no param with that key then an error is returned. If value is a string, then "string" is returned. If value is an array of strings, then "[]string" is returned. No other types are (currently) supported - if the value is any other type then an error is returned.
type StringArray ¶
type StringArray struct {
Strings []string
}
StringArray represents an array of strings. It wraps a standard Go array and provides gomobile-compatible methods that allow a caller to use this type in an array-like manner.
func NewStringArray ¶
func NewStringArray() *StringArray
NewStringArray returns a new string array. It acts as a gomobile-compatible wrapper around a Go string array.
func (*StringArray) Append ¶
func (s *StringArray) Append(value string) *StringArray
Append appends the given string to the array. It returns a reference to the StringArray in order to allow a caller to chain together Append calls.
func (*StringArray) AtIndex ¶
func (s *StringArray) AtIndex(index int) string
AtIndex returns the string at the given index. If the index passed in is out of bounds, then an empty string is returned.
func (*StringArray) Length ¶
func (s *StringArray) Length() int
Length returns the number of strings contained within this StringArray object.
type StringArrayArray ¶
type StringArrayArray struct {
// contains filtered or unexported fields
}
StringArrayArray represents an array of StringArray.
func NewStringArrayArray ¶
func NewStringArrayArray() *StringArrayArray
NewStringArrayArray creates new StringArrayArray.
func StringArrayArrayFromGoArray ¶
func StringArrayArrayFromGoArray(arrayArray [][]string) *StringArrayArray
StringArrayArrayFromGoArray converts [][]string to StringArrayArray.
func (*StringArrayArray) Add ¶
func (a *StringArrayArray) Add(cred *StringArray) *StringArrayArray
Add adds new item to underlying array.
func (*StringArrayArray) AtIndex ¶
func (a *StringArrayArray) AtIndex(index int) *StringArray
AtIndex returns the StringArray at the given index. If the index passed in is out of bounds, then nil is returned.
func (*StringArrayArray) Length ¶
func (a *StringArrayArray) Length() int
Length returns the number of StringArrays contained within this StringArrayArray.
type VerificationMethod ¶
type VerificationMethod struct { ID string Type string Key models.VerificationKey }
VerificationMethod represents a DID verification method.
func NewVerificationMethod ¶
func NewVerificationMethod(keyID, vmType string) *VerificationMethod
NewVerificationMethod creates VerificationMethod.
func (*VerificationMethod) ToSDKVerificationMethod ¶
func (vm *VerificationMethod) ToSDKVerificationMethod() *models.VerificationMethod
ToSDKVerificationMethod returns this VerificationMethod as a models.VerificationMethod.