connector

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cli iface.Client) *Client

func (*Client) FulfillEvent

func (c *Client) FulfillEvent(ctx context.Context, req FulfillEventRequest) *Error

func (*Client) FulfillVerifyProofEvent

func (c *Client) FulfillVerifyProofEvent(ctx context.Context, req FulfillVerifyProofEventRequest) *Error

func (*Client) VerifyPassport

func (c *Client) VerifyPassport(ctx context.Context, req VerifyPassportRequest) error

type Error

type Error struct {
	Code ErrorCode
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

type ErrorCode

type ErrorCode string

ErrorCode represents an error with a code indicating the unhappy flow that occurred

const (
	CodeEventExpired     ErrorCode = "event_expired"     // event type is expired
	CodeEventDisabled    ErrorCode = "event_disabled"    // event type is disabled or not configured
	CodeEventNotFound    ErrorCode = "event_not_found"   // specific event not found for user
	CodeNullifierUnknown ErrorCode = "nullifier_unknown" // nullifier is unknown, while external_id was provided
	CodeInternalError    ErrorCode = "internal_error"    // other errors
)

func (ErrorCode) JSONAPIError

func (c ErrorCode) JSONAPIError() *jsonapi.ErrorObject

type FulfillEventRequest

type FulfillEventRequest struct {
	Nullifier  string  `json:"nullifier"`
	EventType  string  `json:"event_type"`
	ExternalID *string `json:"external_id,omitempty"`
}

type FulfillVerifyProofEventRequest

type FulfillVerifyProofEventRequest struct {
	Nullifier         string   `json:"nullifier"`
	ProofTypes        []string `json:"proof_types"`
	VerifierNullifier string   `json:"verifier_nullifier"`
}

type Pointer

type Pointer interface {
	Points() *Client
}

func NewPointer

func NewPointer(getter kv.Getter) Pointer

type VerifyPassportRequest

type VerifyPassportRequest struct {
	Nullifier  string   `json:"nullifier"`
	Hash       string   `json:"hash"`
	SharedData []string `json:"shared_data"`
	IsUSA      bool     `json:"is_usa"`
}

Jump to

Keyboard shortcuts

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