Documentation ¶
Index ¶
- Constants
- func CommitCacheHandler(c *fiber.Ctx) error
- func GetCacheEntryHandler(c *fiber.Ctx) error
- func ReserveCacheHandler(c *fiber.Ctx) error
- func StartProxyServer(ctx context.Context, opts *ProxyServerOptions) error
- func UploadCacheHandler(c *fiber.Ctx) error
- type AuthMethod
- type AzureBlobCommitCacheResponse
- type AzureBlobDeleteCacheResponse
- type AzureBlobGetCacheResponse
- type AzureBlobReserveCacheResponse
- type CacheBackendInfo
- type CacheEntry
- type CacheEntryData
- type CacheEntryMetadata
- type ChunkData
- type CommitCacheRequest
- type CommitCacheResponse
- type DeleteCacheRequest
- type DeleteCacheResponse
- type DockerGHACommitCacheRequest
- type DockerGHACommitCacheResponse
- type DockerGHAGetCacheRequest
- type DockerGHAGetCacheResponse
- type DockerGHAReserveCacheRequest
- type DockerGHAReserveCacheResponse
- type DockerGHAUploadCacheRequest
- type DockerGHAUploadCacheResponse
- type GCSCommitCacheResponse
- type GCSDeleteCacheResponse
- type GCSGetCacheResponse
- type GCSReserveCacheResponse
- type GetCacheRequest
- type GetCacheResponse
- type GithubAPIError
- type Provider
- type ProxyServerOptions
- type ReserveCacheRequest
- type ReserveCacheResponse
- type S3CommitCacheResponse
- type S3CompletedPart
- type S3DeleteCacheResponse
- type S3GetCacheResponse
- type S3ReserveCacheResponse
- type ShortLivedToken
Constants ¶
View Source
const PROXY_SERVER_OPTIONS_CONTEXT_KEY = "proxy_server_options"
Variables ¶
This section is empty.
Functions ¶
func CommitCacheHandler ¶
func CommitCacheHandler(c *fiber.Ctx) error
func GetCacheEntryHandler ¶
func GetCacheEntryHandler(c *fiber.Ctx) error
func ReserveCacheHandler ¶
func ReserveCacheHandler(c *fiber.Ctx) error
func StartProxyServer ¶
func StartProxyServer(ctx context.Context, opts *ProxyServerOptions) error
func UploadCacheHandler ¶
func UploadCacheHandler(c *fiber.Ctx) error
Types ¶
type AuthMethod ¶
type AuthMethod string
const ( MethodShortLivedToken AuthMethod = "short_lived_token" MethodPresignedURL AuthMethod = "presigned_url" )
type AzureBlobCommitCacheResponse ¶ added in v0.7.0
type AzureBlobDeleteCacheResponse ¶ added in v0.7.0
type AzureBlobGetCacheResponse ¶ added in v0.7.0
type AzureBlobReserveCacheResponse ¶ added in v0.7.0
type CacheBackendInfo ¶
type CacheEntry ¶
type CacheEntry struct { ID string `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` StorageBackendId string `json:"storage_backend_id"` StorageBackendLocation string `json:"storage_backend_location"` CacheKey string `json:"cache_key"` CacheUserGivenKey string `json:"cache_user_given_key"` CacheVersion string `json:"cache_version"` VCSOrganizationName string `json:"vcs_organization_name"` VCSRepositoryName string `json:"vcs_repository_name"` VCSRef string `json:"vcs_ref"` OrganizationID string `json:"organization_id"` Provider Provider `json:"provider" enum:"gcs,s3,azure_blob"` Metadata CacheEntryMetadata `json:"metadata"` }
type CacheEntryData ¶
type CacheEntryData struct { BackendReserveResponse ReserveCacheResponse S3Parts []S3CompletedPart CacheKey string CacheVersion string Chunks map[int64]ChunkData Mutex sync.Mutex // Mutex to protect access to chunks }
type CacheEntryMetadata ¶
type CommitCacheRequest ¶
type CommitCacheRequest struct { CacheKey string `json:"cache_key" validate:"required"` CacheVersion string `json:"cache_version" validate:"required"` UploadKey string `json:"upload_key"` UploadID string `json:"upload_id"` Parts []S3CompletedPart `json:"parts" validate:"required"` VCSType string `json:"vcs_type" validate:"required"` Provider Provider `json:"provider" enum:"gcs,s3"` }
type CommitCacheResponse ¶
type CommitCacheResponse struct { CacheEntry *CacheEntry `json:"cache_entry"` Provider Provider `json:"provider" enum:"gcs,s3"` GCS *GCSCommitCacheResponse `json:"gcs,omitempty"` S3 *S3CommitCacheResponse `json:"s3,omitempty"` AzureBlob *AzureBlobCommitCacheResponse `json:"azure_blob,omitempty"` }
type DeleteCacheRequest ¶
type DeleteCacheResponse ¶
type DeleteCacheResponse struct { CacheEntry *CacheEntry `json:"cache_entry"` Provider Provider `json:"provider" enum:"gcs,s3,azure_blob"` GCS *GCSDeleteCacheResponse `json:"gcs,omitempty"` S3 *S3DeleteCacheResponse `json:"s3,omitempty"` AzureBlob *AzureBlobDeleteCacheResponse `json:"azure_blob,omitempty"` }
type DockerGHACommitCacheRequest ¶
type DockerGHACommitCacheRequest struct { CacheID int `json:"cacheID"` Size int64 `json:"size"` CacheBackendInfo }
type DockerGHACommitCacheResponse ¶
type DockerGHACommitCacheResponse struct{}
func CommitCache ¶
func CommitCache(ctx context.Context, input DockerGHACommitCacheRequest) (*DockerGHACommitCacheResponse, error)
type DockerGHAGetCacheRequest ¶
type DockerGHAGetCacheRequest struct { Keys []string `json:"keys"` Version string `json:"version"` CacheBackendInfo }
type DockerGHAGetCacheResponse ¶
type DockerGHAGetCacheResponse struct { CacheKey string `json:"cacheKey"` ArchiveLocation string `json:"archiveLocation"` }
func GetCache ¶
func GetCache(ctx context.Context, input DockerGHAGetCacheRequest) (*DockerGHAGetCacheResponse, error)
type DockerGHAReserveCacheRequest ¶
type DockerGHAReserveCacheRequest struct { Key string `json:"key"` Version string `json:"version"` CacheBackendInfo }
type DockerGHAReserveCacheResponse ¶
type DockerGHAReserveCacheResponse struct {
CacheID int `json:"cacheID"`
}
func ReserveCache ¶
func ReserveCache(ctx context.Context, input DockerGHAReserveCacheRequest) (*DockerGHAReserveCacheResponse, error)
type DockerGHAUploadCacheRequest ¶
type DockerGHAUploadCacheRequest struct { CacheID int `json:"cacheID"` Content []byte `json:"content"` ContentRange string `json:"contentRange"` CacheBackendInfo }
type DockerGHAUploadCacheResponse ¶
type DockerGHAUploadCacheResponse struct{}
func UploadCache ¶
func UploadCache(ctx context.Context, input DockerGHAUploadCacheRequest) (*DockerGHAUploadCacheResponse, error)
type GCSCommitCacheResponse ¶
type GCSCommitCacheResponse struct { Method AuthMethod `json:"method" enum:"short_lived_token"` ShortLivedToken *ShortLivedToken `json:"short_lived_token,omitempty"` BucketName string `json:"bucket_name"` ProjectID string `json:"project_id"` CacheKey string `json:"cache_key" validate:"required"` }
type GCSDeleteCacheResponse ¶
type GCSGetCacheResponse ¶
type GCSGetCacheResponse struct { Method AuthMethod `json:"method" enum:"short_lived_token"` ShortLivedToken *ShortLivedToken `json:"short_lived_token,omitempty"` PreSignedURL string `json:"pre_signed_url"` BucketName string `json:"bucket_name"` ProjectID string `json:"project_id"` CacheKey string `json:"cache_key"` CacheVersion string `json:"cache_version"` }
type GCSReserveCacheResponse ¶
type GCSReserveCacheResponse struct { Method AuthMethod `json:"method" enum:"short_lived_token"` ShortLivedToken *ShortLivedToken `json:"short_lived_token,omitempty"` BucketName string `json:"bucket_name"` ProjectID string `json:"project_id"` CacheKey string `json:"cache_key" validate:"required"` }
type GetCacheRequest ¶
type GetCacheResponse ¶
type GetCacheResponse struct { Provider Provider `json:"provider" enum:"gcs,s3"` GCS *GCSGetCacheResponse `json:"gcs,omitempty"` S3 *S3GetCacheResponse `json:"s3,omitempty"` AzureBlob *AzureBlobGetCacheResponse `json:"azure_blob,omitempty"` CacheEntry *CacheEntry `json:"cache_entry"` }
type GithubAPIError ¶
type ProxyServerOptions ¶
type ReserveCacheRequest ¶
type ReserveCacheResponse ¶
type ReserveCacheResponse struct { Provider Provider `json:"provider" enum:"gcs,s3"` GCS *GCSReserveCacheResponse `json:"gcs,omitempty"` S3 *S3ReserveCacheResponse `json:"s3,omitempty"` AzureBlob *AzureBlobReserveCacheResponse `json:"azure_blob,omitempty"` }
type S3CommitCacheResponse ¶
type S3CompletedPart ¶
type S3CompletedPart struct { // Entity tag returned when the part was uploaded. ETag *string // Part number that identifies the part. This is a positive integer between 1 and // 10,000. // // - General purpose buckets - In CompleteMultipartUpload , when a additional // checksum (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , // x-amz-checksum-sha1 , or x-amz-checksum-sha256 ) is applied to each part, the // PartNumber must start at 1 and the part numbers must be consecutive. // Otherwise, Amazon S3 generates an HTTP 400 Bad Request status code and an // InvalidPartOrder error code. // // - Directory buckets - In CompleteMultipartUpload , the PartNumber must start // at 1 and the part numbers must be consecutive. PartNumber *int32 }
Taken from s3 v2 sdk
type S3DeleteCacheResponse ¶
type S3GetCacheResponse ¶
type S3ReserveCacheResponse ¶
type ShortLivedToken ¶
Click to show internal directories.
Click to hide internal directories.