Documentation
¶
Index ¶
- type OciManifest
- type OciManifestConfig
- type Prometheus
- func (p *Prometheus) BuildContainerFile(dockerfilePath string, imageName string) (cstorage.Image, error)
- func (p *Prometheus) DoesImageExist(digest string) (bool, error)
- func (p *Prometheus) GetImageByDigest(digest string) (cstorage.Image, error)
- func (p *Prometheus) MountImage(layerId string) (string, error)
- func (p *Prometheus) PullImage(imageName, dstName string) (*OciManifest, error)
- func (p *Prometheus) PullImageAsync(imageName, dstName string, progressCh chan types.ProgressProperties, ...) error
- func (p *Prometheus) UnMountImage(layerId string, force bool) (bool, error)
- type PrometheusConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OciManifest ¶
type OciManifest struct { SchemaVersion int `json:"schemaVersion"` MediaType string `json:"mediaType"` Config OciManifestConfig `json:"config"` Layers []OciManifestConfig `json:"layers"` }
type OciManifestConfig ¶
type Prometheus ¶
type Prometheus struct { Store cstorage.Store Config PrometheusConfig }
func NewPrometheus ¶
func NewPrometheus(root, graphDriverName string, maxParallelDownloads uint) (*Prometheus, error)
NewPrometheus creates a new Prometheus instance, note that currently * Prometheus only works with custom stores, so you need to pass the * root graphDriverName to create a new one.
func (*Prometheus) BuildContainerFile ¶ added in v0.1.4
func (p *Prometheus) BuildContainerFile(dockerfilePath string, imageName string) (cstorage.Image, error)
BuildContainerFile builds a dockerfile and returns the manifest of the built * image and an error if any.
func (*Prometheus) DoesImageExist ¶
func (p *Prometheus) DoesImageExist(digest string) (bool, error)
DoesImageExist checks if an image exists in the Prometheus store by its * digest. It returns a boolean indicating if the image exists and an error * if any.
func (*Prometheus) GetImageByDigest ¶
func (p *Prometheus) GetImageByDigest(digest string) (cstorage.Image, error)
GetImageByDigest returns an image from the Prometheus store by its digest.
func (*Prometheus) MountImage ¶
func (p *Prometheus) MountImage(layerId string) (string, error)
MountImage mounts an image from the Prometheus store by its main layer * digest. It returns the mount path and an error if any.
func (*Prometheus) PullImage ¶
func (p *Prometheus) PullImage(imageName, dstName string) (*OciManifest, error)
PullImage pulls an image from a remote registry and stores it in the Prometheus store. It returns the manifest of the pulled image and an error if any. Note that the 'docker://' prefix is automatically added to the imageName to make it compatible with the alltransports.ParseImageName method.
func (*Prometheus) PullImageAsync ¶ added in v0.2.0
func (p *Prometheus) PullImageAsync(imageName, dstName string, progressCh chan types.ProgressProperties, manifestCh chan OciManifest) error
PullImageAsync does the same thing as PullImage, but returns right after starting the pull process. The user can track progress in the background by reading from the `progressCh` channel, which contains information about the current blob and its progress. When the pull process is done, the image's manifest will be sent via the `manifestCh` channel, which indicates the process is done.
NOTE: The user is responsible for closing both channels once the operation completes.
func (*Prometheus) UnMountImage ¶
func (p *Prometheus) UnMountImage(layerId string, force bool) (bool, error)
UnMountImage unmounts an image from the Prometheus store by its main layer * digest. It returns a boolean indicating if the unmount was successful and * an error if any.