Documentation ¶
Index ¶
- Constants
- Variables
- type BucketRule
- type CacheConfig
- type CacheProvider
- type Client
- type Config
- type DebugInfodClient
- type DebugInfodClientObjectStorageCache
- type Downloader
- type FilesystemCacheConfig
- type HTTPDebugInfodClient
- type Metadata
- type MetadataManager
- type MetadataState
- type NopDebugInfodClient
- type ObjectStoreMetadata
- func (m *ObjectStoreMetadata) Fetch(ctx context.Context, buildID string) (*Metadata, error)
- func (m *ObjectStoreMetadata) MarkAsCorrupted(ctx context.Context, buildID string) error
- func (m *ObjectStoreMetadata) MarkAsUploaded(ctx context.Context, buildID, hash string) error
- func (m *ObjectStoreMetadata) MarkAsUploading(ctx context.Context, buildID string) error
- type Store
- func (s *Store) Download(req *debuginfopb.DownloadRequest, ...) error
- func (s *Store) Exists(ctx context.Context, req *debuginfopb.ExistsRequest) (*debuginfopb.ExistsResponse, error)
- func (s *Store) FetchDebugInfo(ctx context.Context, buildID string) (string, debuginfopb.DownloadInfo_Source, error)
- func (s *Store) Upload(stream debuginfopb.DebugInfoService_UploadServer) error
- type UploadReader
- type ValidRule
Constants ¶
View Source
const ( // ChunkSize 8MB is the size of the chunks in which debuginfo files are // uploaded and downloaded. AWS S3 has a minimum of 5MB for multi-part uploads // and a maximum of 15MB, and a default of 8MB. ChunkSize = 1024 * 1024 * 8 // MaxMsgSize is the maximum message size the server can receive or send. By default, it is 4MB. MaxMsgSize = 1024 * 1024 * 32 )
Variables ¶
View Source
var ( ErrMetadataShouldExist = errors.New("debug info metadata should exist") ErrMetadataUnexpectedState = errors.New("debug info metadata state is unexpected") // There's no debug info metadata. This could mean that an older version // uploaded the debug info files, but there's no record of the metadata, yet. ErrMetadataNotFound = errors.New("debug info metadata not found") )
View Source
var BucketValid = BucketRule{}
View Source
var ErrDebugInfoAlreadyExists = errors.New("debug info already exists")
View Source
var ErrDebugInfoNotFound = errors.New("debug info not found")
View Source
var Valid = ValidRule{}
Valid is the ValidRule.
Functions ¶
This section is empty.
Types ¶
type BucketRule ¶ added in v0.2.0
type BucketRule struct{}
func (BucketRule) Validate ¶ added in v0.2.0
func (r BucketRule) Validate(value interface{}) error
Validate the bucket config.
type CacheConfig ¶
type CacheConfig struct { Type CacheProvider `yaml:"type"` Config interface{} `yaml:"config"` }
type Client ¶ added in v0.8.0
type Client struct {
// contains filtered or unexported fields
}
func NewDebugInfoClient ¶
func NewDebugInfoClient(conn *grpc.ClientConn) *Client
func (*Client) Downloader ¶ added in v0.12.0
type Config ¶
type Config struct { Bucket *client.BucketConfig `yaml:"bucket"` Cache *CacheConfig `yaml:"cache"` }
type DebugInfodClient ¶ added in v0.8.0
type DebugInfodClient interface {
GetDebugInfo(ctx context.Context, buildid string) (io.ReadCloser, error)
}
func NewDebugInfodClientWithObjectStorageCache ¶ added in v0.8.0
func NewDebugInfodClientWithObjectStorageCache(logger log.Logger, bucket objstore.Bucket, h DebugInfodClient) (DebugInfodClient, error)
NewDebugInfodClientWithObjectStorageCache creates a new DebugInfodClient that caches the debug information in the object storage.
type DebugInfodClientObjectStorageCache ¶ added in v0.8.0
type DebugInfodClientObjectStorageCache struct {
// contains filtered or unexported fields
}
func (*DebugInfodClientObjectStorageCache) GetDebugInfo ¶ added in v0.8.0
func (c *DebugInfodClientObjectStorageCache) GetDebugInfo(ctx context.Context, buildID string) (io.ReadCloser, error)
GetDebugInfo returns debug info for given buildid while caching it in object storage.
type Downloader ¶ added in v0.12.0
type Downloader struct {
// contains filtered or unexported fields
}
func (*Downloader) Close ¶ added in v0.12.0
func (d *Downloader) Close() error
func (*Downloader) Info ¶ added in v0.12.0
func (d *Downloader) Info() *debuginfopb.DownloadInfo
type FilesystemCacheConfig ¶
type FilesystemCacheConfig struct {
Directory string `yaml:"directory"`
}
func NewCache ¶ added in v0.12.0
func NewCache(cacheConf *CacheConfig) (*FilesystemCacheConfig, error)
type HTTPDebugInfodClient ¶ added in v0.8.0
type HTTPDebugInfodClient struct { UpstreamServers []*url.URL // contains filtered or unexported fields }
func NewHTTPDebugInfodClient ¶ added in v0.8.0
func NewHTTPDebugInfodClient(logger log.Logger, serverURLs []string, timeoutDuration time.Duration) (*HTTPDebugInfodClient, error)
NewHTTPDebugInfodClient returns a new HTTP debug info client.
func (*HTTPDebugInfodClient) GetDebugInfo ¶ added in v0.8.0
func (c *HTTPDebugInfodClient) GetDebugInfo(ctx context.Context, buildID string) (io.ReadCloser, error)
GetDebugInfo returns debug information file for given buildID by downloading it from upstream servers.
type Metadata ¶ added in v0.12.0
type Metadata struct { State MetadataState `json:"state"` BuildID string `json:"build_id"` Hash string `json:"hash"` UploadStartedAt int64 `json:"upload_started_at"` UploadFinishedAt int64 `json:"upload_finished_at"` }
type MetadataManager ¶ added in v0.12.0
type MetadataState ¶ added in v0.12.0
type MetadataState int64
const ( MetadataStateUnknown MetadataState = iota // The debug info file is being uploaded. MetadataStateUploading // The debug info file is fully uploaded. MetadataStateUploaded // The debug info file is corrupted. MetadataStateCorrupted )
func (MetadataState) MarshalJSON ¶ added in v0.12.0
func (m MetadataState) MarshalJSON() ([]byte, error)
func (MetadataState) String ¶ added in v0.12.0
func (m MetadataState) String() string
func (*MetadataState) UnmarshalJSON ¶ added in v0.12.0
func (m *MetadataState) UnmarshalJSON(b []byte) error
type NopDebugInfodClient ¶ added in v0.9.0
type NopDebugInfodClient struct{}
func (NopDebugInfodClient) GetDebugInfo ¶ added in v0.9.0
func (NopDebugInfodClient) GetDebugInfo(context.Context, string) (io.ReadCloser, error)
type ObjectStoreMetadata ¶ added in v0.12.0
type ObjectStoreMetadata struct {
// contains filtered or unexported fields
}
func NewObjectStoreMetadata ¶ added in v0.12.0
func NewObjectStoreMetadata(logger log.Logger, bucket objstore.Bucket) *ObjectStoreMetadata
func (*ObjectStoreMetadata) MarkAsCorrupted ¶ added in v0.12.0
func (m *ObjectStoreMetadata) MarkAsCorrupted(ctx context.Context, buildID string) error
func (*ObjectStoreMetadata) MarkAsUploaded ¶ added in v0.12.0
func (m *ObjectStoreMetadata) MarkAsUploaded(ctx context.Context, buildID, hash string) error
func (*ObjectStoreMetadata) MarkAsUploading ¶ added in v0.12.0
func (m *ObjectStoreMetadata) MarkAsUploading(ctx context.Context, buildID string) error
type Store ¶
type Store struct { debuginfopb.UnimplementedDebugInfoServiceServer // contains filtered or unexported fields }
func NewStore ¶
func NewStore( logger log.Logger, cacheDir string, metadata MetadataManager, bucket objstore.Bucket, debuginfodClient DebugInfodClient, ) (*Store, error)
NewStore returns a new debug info store.
func (*Store) Download ¶ added in v0.12.0
func (s *Store) Download(req *debuginfopb.DownloadRequest, stream debuginfopb.DebugInfoService_DownloadServer) error
func (*Store) Exists ¶
func (s *Store) Exists(ctx context.Context, req *debuginfopb.ExistsRequest) (*debuginfopb.ExistsResponse, error)
func (*Store) FetchDebugInfo ¶ added in v0.12.0
func (s *Store) FetchDebugInfo(ctx context.Context, buildID string) (string, debuginfopb.DownloadInfo_Source, error)
func (*Store) Upload ¶
func (s *Store) Upload(stream debuginfopb.DebugInfoService_UploadServer) error
type UploadReader ¶
type UploadReader struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.