Versions in this module Expand all Collapse all v0 v0.1.7 May 20, 2024 v0.1.6 Nov 2, 2023 Changes in this version + var ErrUnsetTransactionTime = errors.New("TransactionTime.Set has not been called") + var ErrorExportJobNotFound = errors.New("job URL returned 404 not found") + var ErrorGreaterThanOneContentLocation = errors.New("greater than 1 Content-Location header") + var ErrorRetryableHTTPStatus = errors.New("this is a retryable but unexpected HTTP status code error") + var ErrorTimeout = errors.New("this operation timed out") + var ErrorUnauthorized = errors.New("server indicates this client is unauthorized") + var ErrorUnexpectedNumberOfXProgress = errors.New("unexpected number of x-progress headers") + var ErrorUnexpectedStatusCode = errors.New("unexpected non-ok HTTP status code") + var ErrorUnimplemented = errors.New("method not implemented yet") + var ExportGroupAll = "all" + func ResourceTypeCodeFromName(name string) (cpb.ResourceTypeCode_Value, error) + func ResourceTypeCodeToName(val cpb.ResourceTypeCode_Value) (string, error) + type Authenticator interface + AddAuthenticationToRequest func(hc *http.Client, req *http.Request) error + Authenticate func(hc *http.Client) error + AuthenticateIfNecessary func(hc *http.Client) error + func NewHTTPBasicOAuthAuthenticator(username, password, tokenURL string, opts *HTTPBasicOAuthOptions) (Authenticator, error) + func NewJWTOAuthAuthenticator(issuer, subject, tokenURL string, keyProvider JWTKeyProvider, ...) (Authenticator, error) + type BearerToken struct + AlwaysAuthenticateIfNoExpiry bool + Expiry time.Time + Token string + func DoOAuthExchange(hc *http.Client, req *http.Request, defaultExpiry time.Duration, ...) (*BearerToken, error) + type BearerTokenAuthenticator struct + Exchanger CredentialExchanger + func (bta *BearerTokenAuthenticator) AddAuthenticationToRequest(hc *http.Client, req *http.Request) error + func (bta *BearerTokenAuthenticator) Authenticate(hc *http.Client) error + func (bta *BearerTokenAuthenticator) AuthenticateIfNecessary(hc *http.Client) error + type Client struct + func NewClient(baseURL string, authenticator Authenticator) (*Client, error) + func (c *Client) Authenticate() error + func (c *Client) AuthenticateIfNecessary() error + func (c *Client) Close() error + func (c *Client) GetData(bcdaURL string) (dataStream io.ReadCloser, err error) + func (c *Client) JobStatus(jobStatusURL string) (st JobStatus, err error) + func (c *Client) MonitorJobStatus(jobStatusURL string, checkPeriod, timeout time.Duration) <-chan *MonitorResult + func (c *Client) StartBulkDataExport(types []cpb.ResourceTypeCode_Value, since time.Time, groupID string) (jobStatusURL string, err error) + func (c *Client) StartBulkDataExportAll(types []cpb.ResourceTypeCode_Value, since time.Time) (jobStatusURL string, err error) + type CredentialExchanger interface + Authenticate func(hc *http.Client) (*BearerToken, error) + type HTTPBasicOAuthOptions struct + AlwaysAuthenticateIfNoExpiresIn bool + DefaultExpiry time.Duration + Scopes []string + type JWTKeyProvider interface + Key func() (*rsa.PrivateKey, error) + KeyID func() string + func NewPEMFileKeyProvider(filename, keyID string) JWTKeyProvider + type JWTOAuthOptions struct + AlwaysAuthenticateIfNoExpiresIn bool + DefaultExpiry time.Duration + JWTLifetime time.Duration + Scopes []string + type JobStatus struct + IsComplete bool + PercentComplete int + ResultURLs map[cpb.ResourceTypeCode_Value][]string + RetryAfter time.Duration + TransactionTime time.Time + type MonitorResult struct + Error error + Status JobStatus + type TransactionTime struct + func NewTransactionTime() *TransactionTime + func (tt *TransactionTime) Get() (time.Time, error) + func (tt *TransactionTime) Set(timestamp time.Time) + type TransactionTimeStore interface + Load func(ctx context.Context) (time.Time, error) + Store func(ctx context.Context, ts time.Time) error + func NewGCSTransactionTimeStore(ctx context.Context, gcsEndpoint, uri string) (TransactionTimeStore, error) + func NewInMemoryTransactionTimeStore(timestamp string) (TransactionTimeStore, error) + func NewLocalFileTransactionTimeStore(path string) TransactionTimeStore