grpcc

package
v0.0.0-...-02c3ccb Latest Latest
Warning

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

Go to latest
Published: May 22, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

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) Retry

func (c *Client) Retry(ctx context.Context, req *tpb.UpdateEntryRequest) error

Retry will take a pre-fabricated request and send it again.

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.

Jump to

Keyboard shortcuts

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