Documentation ¶
Index ¶
- func ParseImageReference(ref name.Reference, defaultRegistry string) (imageName, identifier string)
- type ApiResponse
- type Builder
- type Configuration
- type Database
- func (d *Database) Close()
- func (d *Database) GetFilesWithRanks(imageSerial int64) ([]*send.RankedFile, error)
- func (d *Database) GetImage(image, identifier, platform string) (serial int64, err error)
- func (d *Database) GetImageByDigest(image, digest string) (serial int64, err error)
- func (d *Database) GetLayers(imageSerial int64) ([]*send.ImageLayer, error)
- func (d *Database) GetManifestAndConfig(serial int64) (config, manifest []byte, digest string, err error)
- func (d *Database) GetRoughDeduplicatedLayers(fromSerial, toSerial int64) ([]*send.ImageLayer, error)
- func (d *Database) GetUniqueFiles(layers []*send.ImageLayer) ([]*send.File, error)
- func (d *Database) InitDatabase() error
- func (d *Database) InsertFiles(txn *sql.Tx, fsId int64, entries map[string]*common.TraceableEntry) (err error)
- func (d *Database) InsertImage(image, hash string, config *v1.ConfigFile, manifest *v1.Manifest, ...) (serial int64, existing bool, err error)
- func (d *Database) InsertLayer(txn *sql.Tx, size int64, imageSerial, stackIndex int64, layerDigest string) (fsId int64, existing bool, err error)
- func (d *Database) SetImageReady(ready bool, serial int64) error
- func (d *Database) SetImageTag(name, tag, platform string, serial int64) error
- func (d *Database) UpdateFileRanks(collection *fs.TraceCollection) (fs [][][]int64, err error)
- type Extractor
- type Server
- type StarlightProxy
- func (a *StarlightProxy) DeltaImage(from, to, platform string) (reader io.ReadCloser, manifestSize, configSize, starlightHeaderSize int64, ...)
- func (a *StarlightProxy) Notify(ref name.Reference) error
- func (a *StarlightProxy) Ping() (int64, string, string, error)
- func (a *StarlightProxy) Report(body io.Reader) error
- func (a *StarlightProxy) SetAuth(username, password string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApiResponse ¶ added in v0.2.0
type Builder ¶ added in v0.2.0
type Builder struct { send.DeltaBundle // contains filtered or unexported fields }
func (*Builder) WriteHeader ¶ added in v0.2.0
type Configuration ¶ added in v0.2.0
type Configuration struct { // server ListenPort int `json:"port"` ListenAddress string `json:"address"` LogLevel string `json:"log_level"` // database PostgresConnectionString string `json:"postgres"` // registry DefaultRegistry string `json:"default_registry"` // goharbor hook EnableHarborScanner bool `json:"harbor"` HarborApiKey string `json:"harbor_apikey"` // layer cache timeout (second) CacheTimeout int `json:"cache_timeout"` }
func LoadConfig ¶ added in v0.2.0
func LoadConfig(cfgPath string) (c *Configuration, p string, n bool, error error)
func NewConfig ¶ added in v0.2.0
func NewConfig() *Configuration
func (*Configuration) SaveConfig ¶ added in v0.2.0
func (c *Configuration) SaveConfig() error
type Database ¶ added in v0.2.0
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶ added in v0.2.0
func (*Database) GetFilesWithRanks ¶ added in v0.2.0
func (d *Database) GetFilesWithRanks(imageSerial int64) ([]*send.RankedFile, error)
func (*Database) GetImageByDigest ¶ added in v0.2.0
func (*Database) GetLayers ¶ added in v0.2.0
func (d *Database) GetLayers(imageSerial int64) ([]*send.ImageLayer, error)
func (*Database) GetManifestAndConfig ¶ added in v0.2.0
func (*Database) GetRoughDeduplicatedLayers ¶ added in v0.2.0
func (d *Database) GetRoughDeduplicatedLayers(fromSerial, toSerial int64) ([]*send.ImageLayer, error)
GetRoughDeduplicatedLayers returns the likely unique files because it would be hard for the database to apply overlayfs correctly, so this deduplication does not consider whiteout files.
func (*Database) GetUniqueFiles ¶ added in v0.2.0
func (*Database) InitDatabase ¶ added in v0.2.0
func (*Database) InsertFiles ¶ added in v0.2.0
func (*Database) InsertImage ¶ added in v0.2.0
func (*Database) InsertLayer ¶ added in v0.2.0
func (*Database) SetImageReady ¶ added in v0.2.0
func (*Database) SetImageTag ¶ added in v0.2.0
func (*Database) UpdateFileRanks ¶ added in v0.2.0
func (d *Database) UpdateFileRanks(collection *fs.TraceCollection) (fs [][][]int64, err error)
type Extractor ¶ added in v0.2.0
type Extractor struct { Image string `json:"requested-image"` ParsedName string `json:"parsed-image-name"` ParsedTag string `json:"parsed-tag"` // contains filtered or unexported fields }
Extractor extract ToC from starlight-formatted container image and save it to the database
func NewExtractor ¶ added in v0.2.0
func (*Extractor) SaveToC ¶ added in v0.2.0
func (ex *Extractor) SaveToC() (res *ApiResponse, err error)
SaveToC save ToC to the backend database and return ApiResponse if success. It does require the container registry is functioning correctly.
type StarlightProxy ¶ added in v0.2.0
type StarlightProxy struct {
// contains filtered or unexported fields
}
func NewStarlightProxy ¶ added in v0.2.0
func NewStarlightProxy(ctx context.Context, protocol, server string) *StarlightProxy
func (*StarlightProxy) DeltaImage ¶ added in v0.2.0
func (a *StarlightProxy) DeltaImage(from, to, platform string) ( reader io.ReadCloser, manifestSize, configSize, starlightHeaderSize int64, digest, slDigest string, err error)
func (*StarlightProxy) Notify ¶ added in v0.2.0
func (a *StarlightProxy) Notify(ref name.Reference) error
func (*StarlightProxy) Ping ¶ added in v0.2.0
func (a *StarlightProxy) Ping() (int64, string, string, error)
func (*StarlightProxy) Report ¶ added in v0.2.0
func (a *StarlightProxy) Report(body io.Reader) error
func (*StarlightProxy) SetAuth ¶ added in v0.2.0
func (a *StarlightProxy) SetAuth(username, password string)
Click to show internal directories.
Click to hide internal directories.