Documentation ¶
Index ¶
- Constants
- Variables
- func BToInt32(v []byte) uint32
- func BToInt64(v []byte) uint64
- func ConfigLogger() (ctx context.Context)
- func ConfigLoggerWithLevel(level string) (ctx context.Context)
- func ExportToJsonFile(v interface{}, p string) error
- func FindProjectRoot() string
- func GetEtcConfigPath() string
- func GetRandomId(prefix string) string
- func Int32ToB(v uint32) []byte
- func Int64ToB(v uint64) []byte
- func NewStarlightLayer(f *os.File, stargzWriter *common.Writer) (goreg.Layer, error)
- func OpenDatabase(ctx context.Context, dbPath string) (*bolt.DB, error)
- func VersionAction(context *cli.Context) error
- func VersionCommand() *cli.Command
- type Convertor
- type CountWriter
- type DigestWriter
- type StarlightLayer
- func (l StarlightLayer) Compressed() (io.ReadCloser, error)
- func (l StarlightLayer) DiffID() (goreg.Hash, error)
- func (l StarlightLayer) Digest() (goreg.Hash, error)
- func (l StarlightLayer) MediaType() (types.MediaType, error)
- func (l StarlightLayer) Size() (int64, error)
- func (l StarlightLayer) Uncompressed() (io.ReadCloser, error)
Constants ¶
View Source
const ( ImageNameLabel = "containerd.io/snapshot/remote/starlight/imageName.label" ImageTagLabel = "containerd.io/snapshot/remote/starlight/imageTag.label" OptimizeLabel = "containerd.io/snapshot/remote/starlight/optimize.label" OptimizeGroupLabel = "containerd.io/snapshot/remote/starlight/optimizeGroup.label" ProxyLabel = "containerd.io/snapshot/remote/starlight/proxy" SnapshotterLabel = "containerd.io/gc.ref.snapshot.starlight" UserRwLayerText = "containerd.io/layer/user-rw-layer" StarlightTOCDigestAnnotation = "containerd.io/snapshot/remote/starlight/toc.digest" StarlightTOCCreationTimeAnnotation = "containerd.io/snapshot/remote/starlight/toc.timestamp" // ImageMediaTypeManifestV2 for containerd image TYPE field ImageMediaTypeManifestV2 = "application/vnd.docker.distribution.manifest.v2+json" // ImageLabelPuller and ImageLabelStarlightMetadata are labels for containerd image ImageLabelPuller = "puller.containerd.io" ImageLabelStarlightMetadata = "metadata.starlight.mc256.dev" // ContentLabelStarlightMediaType is the media type of the content, can be manifest, config, or starlight ContentLabelStarlightMediaType = "mediaType.starlight.mc256.dev" // ContentLabelContainerdGC prevents containerd from removing the content ContentLabelContainerdGC = "containerd.io/gc.ref.content" ContentLabelSnapshotGC = "containerd.io/gc.ref.snapshot.starlight" ContentLabelCompletion = "complete.starlight.mc256.dev" // --------------------------------------------------------------------------------- // Snapshot labels have a prefix of "containerd.io/snapshot/" // or are the "containerd.io/snapshot.ref" label. // SnapshotLabelRefImage is the digest of the image manifest SnapshotLabelRefImage = "containerd.io/snapshot/starlight.ref.image" SnapshotLabelRefUncompressed = "containerd.io/snapshot/starlight.ref.uncompressed" SnapshotLabelRefLayer = "containerd.io/snapshot/starlight.ref.layer" // find the project root directory ProjectIdentifier = "module github.com/mc256/starlight" )
Variables ¶
View Source
var Version = "0.0.0"
Functions ¶
func ConfigLogger ¶
func ConfigLoggerWithLevel ¶
func ExportToJsonFile ¶
func FindProjectRoot ¶ added in v0.2.0
func FindProjectRoot() string
FindProjectRoot returns the root directory of the Git project if exists. otherwise, it returns os.Getwd(). To identify whether a directory is a root directory, it check the `go.mod` file please making sure the first line of the go mode file is: ``` module github.com/mc256/starlight ```
func GetEtcConfigPath ¶ added in v0.2.0
func GetEtcConfigPath() string
GetEtcConfigPath return a path to the configuration json
func GetRandomId ¶ added in v0.2.0
func NewStarlightLayer ¶ added in v0.2.0
NewStarlightLayer mainly populate the hash values for the StarlightLayer object
func VersionAction ¶
func VersionAction(context *cli.Context) error
func VersionCommand ¶
func VersionCommand() *cli.Command
Types ¶
type Convertor ¶ added in v0.2.0
type Convertor struct {
// contains filtered or unexported fields
}
func NewConvertor ¶ added in v0.2.0
func (*Convertor) ToStarlightImage ¶ added in v0.2.0
type CountWriter ¶
type CountWriter struct {
// contains filtered or unexported fields
}
func NewCountWriter ¶
func NewCountWriter(w io.Writer) (cw *CountWriter)
func (*CountWriter) GetWrittenSize ¶
func (c *CountWriter) GetWrittenSize() int64
type DigestWriter ¶ added in v0.2.0
type DigestWriter struct {
// contains filtered or unexported fields
}
func NewDigestWriter ¶ added in v0.2.0
func NewDigestWriter(w io.Writer) (dw *DigestWriter)
func (*DigestWriter) GetDigest ¶ added in v0.2.0
func (d *DigestWriter) GetDigest() []byte
type StarlightLayer ¶ added in v0.2.0
type StarlightLayer struct { R io.Reader // Diff is the hash of the uncompressed layer Diff goreg.Hash // Hash is the hash of the compressed layer Hash goreg.Hash SizeVal int64 }
func (StarlightLayer) Compressed ¶ added in v0.2.0
func (l StarlightLayer) Compressed() (io.ReadCloser, error)
func (StarlightLayer) MediaType ¶ added in v0.2.0
func (l StarlightLayer) MediaType() (types.MediaType, error)
func (StarlightLayer) Size ¶ added in v0.2.0
func (l StarlightLayer) Size() (int64, error)
func (StarlightLayer) Uncompressed ¶ added in v0.2.0
func (l StarlightLayer) Uncompressed() (io.ReadCloser, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.