Documentation
¶
Index ¶
- Constants
- Variables
- func AssertS3Object(t testing.TB, ctx context.Context, client *awss3.Client, bucket, key string, ...)
- func BufferedFundingAmount(requiredText, capText, bufferText string) (string, error)
- func CriticalReadinessSatisfied(result ReadinessResult) bool
- func DiagnosticValue(value any) string
- func Eventually[T any](t testing.TB, ctx context.Context, timeout time.Duration, description string, ...) T
- func LoadCalibrationPrivateKey(repoRoot string) (string, error)
- func NewS3Client(endpoint, accessKey, secretKey string) *awss3.Client
- func NewUnixSocketS3Client(socketPath, accessKey, secretKey string) *awss3.Client
- func ReadDotEnvFile(path string) (map[string]string, error)
- func Redact(value string) string
- func RepoRootFrom(start string) (string, error)
- type AdminClient
- func (a *AdminClient) Authenticate(ctx context.Context, username, password string) error
- func (a *AdminClient) BaseURL() string
- func (a *AdminClient) CreateS3User(t testing.TB, ctx context.Context) S3Credentials
- func (a *AdminClient) DoJSON(ctx context.Context, method, path string, payload, output any) (string, error)
- func (a *AdminClient) GetJSON(ctx context.Context, path string, output any) (string, error)
- func (a *AdminClient) Health(ctx context.Context) (HealthResponse, string, error)
- func (a *AdminClient) Login(t testing.TB, ctx context.Context, username, password string)
- func (a *AdminClient) PostJSON(t testing.TB, ctx context.Context, path string, payload, output any)
- func (a *AdminClient) Settings(ctx context.Context) (SettingsResponse, string, error)
- type AdminClientOption
- type BoundedLog
- type DataSetObservation
- type DataSetObservationPage
- type EventuallyOption
- type HealthResponse
- type ObjectListItem
- type ObjectListResponse
- type ObjectLocation
- type ObservabilitySummary
- type ProvenanceCopy
- type ProvenanceResponse
- type ProviderObservation
- type ProviderObservationPage
- type ReadinessCheck
- type ReadinessPlan
- type ReadinessPlanState
- type ReadinessResult
- type S3Credentials
- type SettingsResponse
- type TaskItem
- type TaskListResponse
- type WaitSnapshot
- type WalletBalances
- type WalletOperation
- type WalletOperationResponse
- type WalletOperationsResponse
- type WalletResponse
Constants ¶
View Source
const ( ReadinessReady = "ready" ReadinessWarning = "warning" ReadinessBlocked = "blocked" ReadinessUnknown = "unknown" ReadinessActionNone = "none" ReadinessActionApprove = "approve" ReadinessActionFund = "fund" DepositCapUSDFCBaseUnits = "2000000000000000000" FundingBufferBaseUnits = "500000000000000000" )
View Source
const ( CalibrationPrivateKeyEnv = "SYNAPS3_CALIBRATION_PRIVATE_KEY" TestEnvFileName = ".env.test" )
Variables ¶
View Source
var CriticalReadinessChecks = []string{
"network_match",
"wallet_fil_gas",
"providers",
"storage_cost",
"payment_funding",
"fwss_approval",
}
Functions ¶
func AssertS3Object ¶
func BufferedFundingAmount ¶
BufferedFundingAmount adds an optional buffer without reducing the required amount to fit the transaction cap.
func CriticalReadinessSatisfied ¶
func CriticalReadinessSatisfied(result ReadinessResult) bool
func DiagnosticValue ¶
func Eventually ¶
func NewS3Client ¶
func NewUnixSocketS3Client ¶
func RepoRootFrom ¶
Types ¶
type AdminClient ¶
type AdminClient struct {
// contains filtered or unexported fields
}
AdminClient is a small black-box client for the SynapS3 Admin API.
func NewAdminClient ¶
func NewAdminClient(t testing.TB, baseURL string, options ...AdminClientOption) *AdminClient
NewAdminClient creates an Admin API client with cookie support.
func (*AdminClient) Authenticate ¶
func (a *AdminClient) Authenticate(ctx context.Context, username, password string) error
func (*AdminClient) BaseURL ¶
func (a *AdminClient) BaseURL() string
func (*AdminClient) CreateS3User ¶
func (a *AdminClient) CreateS3User(t testing.TB, ctx context.Context) S3Credentials
func (*AdminClient) Health ¶
func (a *AdminClient) Health(ctx context.Context) (HealthResponse, string, error)
func (*AdminClient) Settings ¶
func (a *AdminClient) Settings(ctx context.Context) (SettingsResponse, string, error)
type AdminClientOption ¶
type AdminClientOption func(*AdminClient)
func WithAdminTimeout ¶
func WithAdminTimeout(timeout time.Duration) AdminClientOption
type BoundedLog ¶
type BoundedLog struct {
// contains filtered or unexported fields
}
func NewBoundedLog ¶
func NewBoundedLog(limit int) *BoundedLog
func (*BoundedLog) String ¶
func (b *BoundedLog) String() string
type DataSetObservation ¶
type DataSetObservation struct {
Facts struct {
BucketName string `json:"bucket_name"`
ProviderID string `json:"provider_id"`
ChainDataSetID *string `json:"chain_data_set_id,omitempty"`
} `json:"facts"`
Signal struct {
Status string `json:"status"`
Level string `json:"level"`
ReasonCodes []string `json:"reason_codes"`
LastError *string `json:"last_error,omitempty"`
} `json:"signal"`
}
type DataSetObservationPage ¶
type DataSetObservationPage struct {
Items []DataSetObservation `json:"items"`
Summary ObservabilitySummary `json:"summary"`
}
type EventuallyOption ¶
type EventuallyOption func(*eventuallyOptions)
func WithPollInterval ¶
func WithPollInterval(interval time.Duration) EventuallyOption
type HealthResponse ¶
type ObjectListItem ¶
type ObjectListItem struct {
Key string `json:"key"`
CurrentVersionID string `json:"current_version_id"`
State string `json:"state"`
Status string `json:"status"`
Location ObjectLocation `json:"location"`
}
type ObjectListResponse ¶
type ObjectListResponse struct {
Objects []ObjectListItem `json:"objects"`
}
type ObjectLocation ¶
type ObservabilitySummary ¶
type ProvenanceCopy ¶
type ProvenanceResponse ¶
type ProvenanceResponse struct {
State string `json:"state"`
Status string `json:"status"`
RequestedCopies int `json:"requested_copies"`
SuccessCopies int `json:"success_copies"`
Copies []ProvenanceCopy `json:"copies"`
}
type ProviderObservation ¶
type ProviderObservation struct {
Facts struct {
ProviderID string `json:"provider_id"`
Active *bool `json:"active,omitempty"`
HasPDP *bool `json:"has_pdp,omitempty"`
ServiceURL *string `json:"service_url,omitempty"`
HealthStatus *string `json:"health_status,omitempty"`
} `json:"facts"`
Signal struct {
Status string `json:"status"`
Level string `json:"level"`
ReasonCodes []string `json:"reason_codes"`
LastError *string `json:"last_error,omitempty"`
} `json:"signal"`
}
type ProviderObservationPage ¶
type ProviderObservationPage struct {
Items []ProviderObservation `json:"items"`
Summary ObservabilitySummary `json:"summary"`
}
type ReadinessCheck ¶
type ReadinessCheck struct {
ID string `json:"id"`
Status string `json:"status"`
Message string `json:"message"`
Action string `json:"action,omitempty"`
RequiredUSDFC string `json:"required_usdfc,omitempty"`
}
func NonCriticalWarnings ¶
func NonCriticalWarnings(result ReadinessResult) []ReadinessCheck
type ReadinessPlan ¶
func PlanReadinessAction ¶
func PlanReadinessAction(state ReadinessPlanState) (ReadinessPlan, error)
type ReadinessPlanState ¶
type ReadinessResult ¶
type ReadinessResult struct {
Status string `json:"status"`
Mode string `json:"mode"`
Checks []ReadinessCheck `json:"checks"`
PartialErrors map[string]string `json:"partial_errors,omitempty"`
}
func (ReadinessResult) Check ¶
func (r ReadinessResult) Check(id string) (ReadinessCheck, bool)
type S3Credentials ¶
type SettingsResponse ¶
type TaskItem ¶
type TaskItem struct {
ID int64 `json:"id"`
Type string `json:"type"`
Operation string `json:"operation"`
Status string `json:"status"`
PresentationStatus string `json:"presentation_status"`
SubjectType *string `json:"subject_type,omitempty"`
SubjectKey *string `json:"subject_key,omitempty"`
RetryCount int `json:"retry_count"`
MaxAttempts *int `json:"max_attempts"`
LastError *string `json:"last_error,omitempty"`
StatusMessage *string `json:"status_message,omitempty"`
WaitReason *string `json:"wait_reason,omitempty"`
AvailableAt string `json:"available_at"`
}
type TaskListResponse ¶
type WaitSnapshot ¶
type WaitSnapshot struct {
Description string `json:"description"`
Last any `json:"last,omitempty"`
LastError string `json:"last_error,omitempty"`
Elapsed string `json:"elapsed"`
}
func NewWaitSnapshot ¶
type WalletBalances ¶
type WalletBalances struct {
USDFC *string `json:"usdfc"`
}
type WalletOperation ¶
type WalletOperationResponse ¶
type WalletOperationResponse struct {
Operation WalletOperation `json:"operation"`
}
type WalletOperationsResponse ¶
type WalletOperationsResponse struct {
Operations []WalletOperation `json:"operations"`
}
type WalletResponse ¶
type WalletResponse struct {
WalletBalances *WalletBalances `json:"wallet_balances,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.