Documentation ¶
Index ¶
- Constants
- type BytesArray
- type CallbackProveClaim
- type CallbackRequestClaim
- type ClaimDB
- func (cdb *ClaimDB) AddCredentialExistance(cred *proof.CredentialExistence) (string, error)
- func (cdb *ClaimDB) GetClaimJSON(id string) (string, error)
- func (cdb *ClaimDB) GetCredExist(id string) (*proof.CredentialExistence, error)
- func (cdb *ClaimDB) GetCredExistJSON(id string) (string, error)
- func (cdb *ClaimDB) IterateClaimsJSON(iterFn ClaimDBIterFner) error
- func (cdb *ClaimDB) IterateClaimsJSON_(fn func(string, string) (bool, error)) error
- func (cdb *ClaimDB) IterateCredExistJSON(iterFn ClaimDBIterFner) error
- func (cdb *ClaimDB) IterateCredExistJSON_(fn func(string, string) (bool, error)) error
- func (cdb *ClaimDB) Iterate_(fn func(string, *proof.CredentialExistence) (bool, error)) error
- type ClaimDBIterFner
- type Event
- type EventManager
- type HttpClient
- type Identity
- func (i *Identity) ProveClaim(baseUrl string, credID string) (bool, error)
- func (i *Identity) ProveClaimWithCb(baseUrl string, credID string, c CallbackProveClaim)
- func (i *Identity) ProveClaimZK(baseUrl string, credID string) (bool, error)
- func (i *Identity) ProveClaimZKWithCb(baseUrl string, credID string, c CallbackProveClaim)
- func (i *Identity) RequestClaim(baseUrl, data string) (*Ticket, error)
- func (i *Identity) RequestClaimWithCb(baseUrl, data string, c CallbackRequestClaim)
- func (i *Identity) Stop()
- type Sender
- type Ticket
- type TicketOperator
- type TicketStatus
- type TicketType
- type Tickets
- func (ts *Tickets) Add(tickets []Ticket) error
- func (ts *Tickets) CancelTicket(id string) error
- func (ts *Tickets) CheckPending(id *Identity, eventCh chan Event, checkPendingPeriod time.Duration, ...)
- func (ts *Tickets) GetPending() ([]*Ticket, error)
- func (ts *Tickets) Init() error
- func (ts *Tickets) Iterate(handler TicketOperator) error
- func (ts *Tickets) Iterate_(fn func(*Ticket) (bool, error)) error
- type ValidationError
Constants ¶
const ( TicketTypeClaimReq = "RequestClaim" TicketTypeTest = "test ticket" TicketStatusDone = "Done" TicketStatusDoneError = "Done with error" TicketStatusPending = "Pending" TicketStatusCancel = "Canceled" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BytesArray ¶
type BytesArray struct {
// contains filtered or unexported fields
}
TODO. HAVE A LOOK AT CODE GEN
func NewBytesArray ¶
func NewBytesArray() *BytesArray
func (*BytesArray) Append ¶
func (ba *BytesArray) Append(bs []byte)
func (*BytesArray) Get ¶
func (ba *BytesArray) Get(i int) []byte
func (*BytesArray) Len ¶
func (ba *BytesArray) Len() int
type CallbackProveClaim ¶
CallbackProveClaim is a interface used to get an asynchronous response from ProveClaimWithCb and ProveClaimZKWithCb
type CallbackRequestClaim ¶
type ClaimDB ¶
type ClaimDB struct {
// contains filtered or unexported fields
}
func NewClaimDB ¶
func (*ClaimDB) AddCredentialExistance ¶
func (cdb *ClaimDB) AddCredentialExistance(cred *proof.CredentialExistence) (string, error)
AddCredentialExistance adds a credential existence to the ClaimDB and returns the id of the entry in the DB.
func (*ClaimDB) GetCredExist ¶
func (cdb *ClaimDB) GetCredExist(id string) (*proof.CredentialExistence, error)
func (*ClaimDB) GetCredExistJSON ¶
GetCredExistJSON returns the requested claim
func (*ClaimDB) IterateClaimsJSON ¶
func (cdb *ClaimDB) IterateClaimsJSON(iterFn ClaimDBIterFner) error
func (*ClaimDB) IterateClaimsJSON_ ¶
func (*ClaimDB) IterateCredExistJSON ¶
func (cdb *ClaimDB) IterateCredExistJSON(iterFn ClaimDBIterFner) error
func (*ClaimDB) IterateCredExistJSON_ ¶
type EventManager ¶
type EventManager struct {
// contains filtered or unexported fields
}
func NewEventManager ¶
func NewEventManager(storage db.Storage, eventQueue chan Event, s Sender) *EventManager
NewEventManager creates an event mannager
func (*EventManager) EventLength ¶
func (em *EventManager) EventLength() (uint32, error)
func (*EventManager) Init ¶
func (em *EventManager) Init() error
func (*EventManager) Start ¶
func (em *EventManager) Start()
func (*EventManager) Stop ¶
func (em *EventManager) Stop()
type HttpClient ¶
type HttpClient struct {
httpclient.HttpClient
}
func NewHttpClient ¶
func NewHttpClient(urlBase string) *HttpClient
type Identity ¶
type Identity struct { ClaimDB *ClaimDB Tickets *Tickets // contains filtered or unexported fields }
func NewIdentity ¶
func NewIdentity(storePath, sharedStorePath, pass, web3Url string, checkTicketsPeriodMilis int, extraGenesisClaims *BytesArray, eventHandler Sender) (*Identity, error)
NewIdentity creates a new identity this funciton is mapped as a constructor in Java. NOTE: The storePath must be unique per Identity. NOTE: Right now the extraGenesisClaims is useless.
func NewIdentityLoad ¶
func NewIdentityLoad(storePath, sharedStorePath, pass, web3Url string, checkTicketsPeriodMilis int, eventHandler Sender) (*Identity, error)
NewIdentityLoad loads an already created identity this funciton is mapped as a constructor in Java
func (*Identity) ProveClaim ¶
ProveClaim sends a credentialValidity build from the given credentialExistance to a verifier. The response should be true if the verified accepted the prove as valid
func (*Identity) ProveClaimWithCb ¶
func (i *Identity) ProveClaimWithCb(baseUrl string, credID string, c CallbackProveClaim)
ProveClaimWithCb sends a credentialValidity build from the given credentialExistance to a verifier. The callback is used to check if the verifier has accepted the credential as valid in an async maner
func (*Identity) ProveClaimZK ¶
ProveClaimZK sends a credentialValidity build from the given credentialExistance to a verifier. This method will generate a zero knowledge proof so the verifier can't see the content of the claim. The response should be true if the verified accepted the prove as valid.
func (*Identity) ProveClaimZKWithCb ¶
func (i *Identity) ProveClaimZKWithCb(baseUrl string, credID string, c CallbackProveClaim)
ProveClaimZKWithCb sends a credentialValidity build from the given credentialExistance to a verifier. This method will generate a zero knowledge proof so the verifier can't see the content of the claim. The callback is used to check if the verifier has accepted the credential as valid in an async maner
func (*Identity) RequestClaim ¶
RequestClaim sends a petition to issue a claim to an issuer. This function will eventually trigger an event, the returned ticket can be used to reference the event
func (*Identity) RequestClaimWithCb ¶
func (i *Identity) RequestClaimWithCb(baseUrl, data string, c CallbackRequestClaim)
type Ticket ¶
type Ticket struct { Id string LastChecked int64 Type string Status string HandlerJSON json.RawMessage // contains filtered or unexported fields }
func (Ticket) MarshalJSON ¶
func (*Ticket) UnmarshalJSON ¶
type TicketOperator ¶
type TicketStatus ¶
type TicketStatus string
type TicketType ¶
type TicketType string
type Tickets ¶
type Tickets struct {
// contains filtered or unexported fields
}
func NewTickets ¶
func (*Tickets) CancelTicket ¶
func (*Tickets) CheckPending ¶
func (*Tickets) GetPending ¶
func (*Tickets) Iterate ¶
func (ts *Tickets) Iterate(handler TicketOperator) error
type ValidationError ¶
type ValidationError struct { FieldError validator.FieldError Next *ValidationError }
func NewValidationError ¶
func NewValidationError(validationErrors validator.ValidationErrors) ValidationError
func (ValidationError) Error ¶
func (e ValidationError) Error() string