{"modulePath":"github.com/hyperhq/hypercli","version":"v1.10.16","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package image\n\n## Types\n\n```go\ntype Exporter interface {\n\tLoad(io.ReadCloser, io.Writer) error\n\t// TODO: Load(net.Context, io.ReadCloser, \u003c- chan StatusMessage) error\n\tSave([]string, io.Writer) error\n}\n```\nExporter provides interface for exporting and importing images\n\n```go\ntype History struct {\n\t// Created timestamp for build point\n\tCreated time.Time `json:\"created\"`\n\t// Author of the build point\n\tAuthor string `json:\"author,omitempty\"`\n\t// CreatedBy keeps the Dockerfile command used while building image.\n\tCreatedBy string `json:\"created_by,omitempty\"`\n\t// Comment is custom message set by the user when creating the image.\n\tComment string `json:\"comment,omitempty\"`\n\t// EmptyLayer is set to true if this history item did not generate a\n\t// layer. Otherwise, the history item is associated with the next\n\t// layer in the RootFS section.\n\tEmptyLayer bool `json:\"empty_layer,omitempty\"`\n}\n```\nHistory stores build commands that were used to create an image\n\n```go\ntype ID digest.Digest\n```\nID is the content-addressable ID of an image.\n\n```go\nfunc (id ID) String() string\n```\n\n```go\ntype IDWalkFunc func(id ID) error\n```\nIDWalkFunc is function called by StoreBackend.Walk\n\n```go\ntype Image struct {\n\tV1Image\n\tParent  ID        `json:\"parent,omitempty\"`\n\tRootFS  *RootFS   `json:\"rootfs,omitempty\"`\n\tHistory []History `json:\"history,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nImage stores the image configuration\n\n```go\nfunc NewFromJSON(src []byte) (*Image, error)\n```\nNewFromJSON creates an Image configuration from json.\n\n```go\nfunc (img *Image) ID() ID\n```\nID returns the image's content-addressable ID.\n\n```go\nfunc (img *Image) ImageID() string\n```\nImageID stringizes ID.\n\n```go\nfunc (img *Image) MarshalJSON() ([]byte, error)\n```\nMarshalJSON serializes the image to JSON. It sorts the top-level keys so that JSON that's been manipulated by a push/pull cycle with a legacy registry won't end up with a different key order.\n\n```go\nfunc (img *Image) RawJSON() []byte\n```\nRawJSON returns the immutable JSON associated with the image.\n\n```go\nfunc (img *Image) RunConfig() *container.Config\n```\nRunConfig returns the image's container config.\n\n```go\ntype LayerGetReleaser interface {\n\tGet(layer.ChainID) (layer.Layer, error)\n\tRelease(layer.Layer) ([]layer.Metadata, error)\n}\n```\nLayerGetReleaser is a minimal interface for getting and releasing images.\n\n```go\ntype RootFS struct {\n\tType    string         `json:\"type\"`\n\tDiffIDs []layer.DiffID `json:\"diff_ids,omitempty\"`\n}\n```\nRootFS describes images root filesystem This is currently a placeholder that only supports layers. In the future this can be made into a interface that supports different implementations.\n\n```go\nfunc NewRootFS() *RootFS\n```\nNewRootFS returns empty RootFS struct\n\n```go\nfunc (r *RootFS) Append(id layer.DiffID)\n```\nAppend appends a new diffID to rootfs\n\n```go\nfunc (r *RootFS) ChainID() layer.ChainID\n```\nChainID returns the ChainID for the top layer in RootFS.\n\n```go\ntype Store interface {\n\tCreate(config []byte) (ID, error)\n\tGet(id ID) (*Image, error)\n\tDelete(id ID) ([]layer.Metadata, error)\n\tSearch(partialID string) (ID, error)\n\tSetParent(id ID, parent ID) error\n\tGetParent(id ID) (ID, error)\n\tChildren(id ID) []ID\n\tMap() map[ID]*Image\n\tHeads() map[ID]*Image\n}\n```\nStore is an interface for creating and accessing images\n\n```go\nfunc NewImageStore(fs StoreBackend, ls LayerGetReleaser) (Store, error)\n```\nNewImageStore returns new store object for given layer store\n\n```go\ntype StoreBackend interface {\n\tWalk(f IDWalkFunc) error\n\tGet(id ID) ([]byte, error)\n\tSet(data []byte) (ID, error)\n\tDelete(id ID) error\n\tSetMetadata(id ID, key string, data []byte) error\n\tGetMetadata(id ID, key string) ([]byte, error)\n\tDeleteMetadata(id ID, key string) error\n}\n```\nStoreBackend provides interface for image.Store persistence\n\n```go\nfunc NewFSStoreBackend(root string) (StoreBackend, error)\n```\nNewFSStoreBackend returns new filesystem based backend for image.Store\n\n```go\ntype V1Image struct {\n\t// ID a unique 64 character identifier of the image\n\tID string `json:\"id,omitempty\"`\n\t// Parent id of the image\n\tParent string `json:\"parent,omitempty\"`\n\t// Comment user added comment\n\tComment string `json:\"comment,omitempty\"`\n\t// Created timestamp when image was created\n\tCreated time.Time `json:\"created\"`\n\t// Container is the id of the container used to commit\n\tContainer string `json:\"container,omitempty\"`\n\t// ContainerConfig  is the configuration of the container that is committed into the image\n\tContainerConfig container.Config `json:\"container_config,omitempty\"`\n\t// DockerVersion specifies version on which image is built\n\tDockerVersion string `json:\"docker_version,omitempty\"`\n\t// Author of the image\n\tAuthor string `json:\"author,omitempty\"`\n\t// Config is the configuration of the container received from the client\n\tConfig *container.Config `json:\"config,omitempty\"`\n\t// Architecture is the hardware that the image is build and runs on\n\tArchitecture string `json:\"architecture,omitempty\"`\n\t// OS is the operating system used to build and run the image\n\tOS string `json:\"os,omitempty\"`\n\t// Size is the total size of the image including all layers it is composed of\n\tSize int64 `json:\",omitempty\"`\n}\n```\nV1Image stores the V1 image configuration.\n\n","path":"github.com/hyperhq/hypercli/image","name":"image","synopsis":"","isRedistributable":true}
