Documentation
¶
Index ¶
- Constants
- Variables
- type BackoffPool
- type Blob
- type Cache
- func (c *Cache) AllKeys(ctx context.Context, api *RestAPI, prefix string) (map[string]struct{}, error)
- func (c *Cache) Load(ctx context.Context, keys ...string) (*Entry, error)
- func (c *Cache) Save(ctx context.Context, key string, b Blob) error
- func (c *Cache) SaveMutable(ctx context.Context, key string, forceTimeout time.Duration, ...) error
- func (c *Cache) Scopes() []Scope
- type CacheKey
- type CommitCacheReq
- type Entry
- type GithubAPIError
- type HTTPError
- type Opt
- type Permission
- type ReaderAtCloser
- type ReserveCacheReq
- type ReserveCacheResp
- type RestAPI
- type Scope
Constants ¶
View Source
const ( PermissionRead = 1 << iota PermissionWrite )
Variables ¶
View Source
var Log = func(string, ...interface{}) {}
View Source
var UploadChunkSize = 32 * 1024 * 1024
View Source
var UploadConcurrency = 4
Functions ¶
This section is empty.
Types ¶
type BackoffPool ¶
type BackoffPool struct {
// contains filtered or unexported fields
}
func (*BackoffPool) Delay ¶
func (b *BackoffPool) Delay()
func (*BackoffPool) Reset ¶
func (b *BackoffPool) Reset()
type Cache ¶
type Cache struct { URL string Token *jwt.Token IssuedAt time.Time ExpiresAt time.Time // contains filtered or unexported fields }
func (*Cache) SaveMutable ¶
func (c *Cache) SaveMutable(ctx context.Context, key string, forceTimeout time.Duration, f func(old *Entry) (Blob, error)) error
SaveMutable stores a blob over a possibly existing key. Previous value is passed to callback that needs to return new blob. Callback may be called multiple times if two saves happen during same time window. In case of a crash a key may remain locked, preventing previous changes. Timeout can be set to force changes in this case without guaranteeing that previous value was up to date.
type CommitCacheReq ¶
type CommitCacheReq struct {
Size int64 `json:"size"`
}
type Entry ¶
type Entry struct { Key string `json:"cacheKey"` Scope string `json:"scope"` URL string `json:"archiveLocation"` // contains filtered or unexported fields }
type GithubAPIError ¶
type GithubAPIError struct { Message string `json:"message"` TypeName string `json:"typeName"` TypeKey string `json:"typeKey"` ErrorCode int `json:"errorCode"` }
func (GithubAPIError) Error ¶
func (e GithubAPIError) Error() string
func (GithubAPIError) Is ¶
func (e GithubAPIError) Is(err error) bool
type Permission ¶
type Permission int
func (Permission) String ¶
func (p Permission) String() string
type ReserveCacheReq ¶
type ReserveCacheResp ¶
type ReserveCacheResp struct {
CacheID int `json:"cacheID"`
}
type Scope ¶
type Scope struct { Scope string Permission Permission }
Click to show internal directories.
Click to hide internal directories.