Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) GetEntry(ctx context.Context, userID, appID string, opts ...grpc.CallOption) ([]byte, *trillian.SignedMapRoot, error)
- func (c *Client) ListHistory(ctx context.Context, userID, appID string, start, end int64, ...) (map[*trillian.SignedMapRoot][]byte, error)
- func (c *Client) Retry(ctx context.Context, req *tpb.UpdateEntryRequest) error
- func (c *Client) Update(ctx context.Context, userID, appID string, profileData []byte, ...) (*tpb.UpdateEntryRequest, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrRetry occurs when an update request has been submitted, but the // results of the udpate are not visible on the server yet. The client // must retry until the request is visible. ErrRetry = errors.New("update not present on server yet") // ErrIncomplete occurs when the server indicates that requested epochs // are not available. ErrIncomplete = errors.New("incomplete account history") // Vlog is the verbose logger. By default it outputs to /dev/null. Vlog = log.New(ioutil.Discard, "", 0) )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { RetryCount int RetryDelay time.Duration // contains filtered or unexported fields }
Client is a helper library for issuing updates to the key server. Client Responsibilities - Trust Model: - - Trusted Monitors - - Verify last X days - Gossip - What is the current value of the root? - - Gossip advancement: advance state between current and server. - Sender queries - Do queries match up against the gossip root? - - List trusted monitors. - Key Owner - - Periodically query own keys. Do they match the private keys I have? - - Sign key update requests.
func New ¶
func New(mapID int64, client spb.KeyTransparencyServiceClient, vrf vrf.PublicKey, verifier crypto.PublicKey, log client.LogVerifier) *Client
New creates a new client.
func (*Client) GetEntry ¶
func (c *Client) GetEntry(ctx context.Context, userID, appID string, opts ...grpc.CallOption) ([]byte, *trillian.SignedMapRoot, error)
GetEntry returns an entry if it exists, and nil if it does not.
func (*Client) ListHistory ¶
func (c *Client) ListHistory(ctx context.Context, userID, appID string, start, end int64, opts ...grpc.CallOption) (map[*trillian.SignedMapRoot][]byte, error)
ListHistory returns a list of profiles starting and ending at given epochs. It also filters out all identical consecutive profiles.
func (*Client) Update ¶
func (c *Client) Update(ctx context.Context, userID, appID string, profileData []byte, signers []signatures.Signer, authorizedKeys []*tpb.PublicKey, opts ...grpc.CallOption) (*tpb.UpdateEntryRequest, error)
Update creates an UpdateEntryRequest for a user, attempt to submit it multiple times depending on RetryCount.