github.com/sealerio/sealer@v0.11.1-0.20240507115618-f4f89c5853ae/pkg/imageengine/interface.go (about) 1 // Copyright © 2022 Alibaba Group Holding Ltd. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package imageengine 16 17 import ( 18 "github.com/containers/common/libimage" 19 "github.com/opencontainers/go-digest" 20 21 v1 "github.com/sealerio/sealer/pkg/define/image/v1" 22 "github.com/sealerio/sealer/pkg/define/options" 23 ) 24 25 type Interface interface { 26 Build(sealerBuildFlags *options.BuildOptions) (string, error) 27 28 CreateContainer(opts *options.FromOptions) (string, error) 29 30 CreateWorkingContainer(opts *options.BuildRootfsOptions) (string, error) 31 32 Mount(opts *options.MountOptions) ([]options.JSONMount, error) 33 34 Copy(opts *options.CopyOptions) error 35 36 Commit(opts *options.CommitOptions) (string, error) 37 38 Config(opts *options.ConfigOptions) error 39 40 Login(opts *options.LoginOptions) error 41 42 Logout(opts *options.LogoutOptions) error 43 44 Push(opts *options.PushOptions) error 45 46 Pull(opts *options.PullOptions) (string, error) 47 48 Images(opts *options.ImagesOptions) error 49 50 Save(opts *options.SaveOptions) error 51 52 Load(opts *options.LoadOptions) error 53 54 RemoveImage(opts *options.RemoveImageOptions) error 55 56 RemoveContainer(opts *options.RemoveContainerOptions) error 57 58 Tag(opts *options.TagOptions) error 59 60 Inspect(opts *options.InspectOptions) (*v1.ImageSpec, error) 61 62 LookupManifest(name string) (*libimage.ManifestList, error) 63 64 CreateManifest(name string, opts *options.ManifestCreateOpts) (string, error) 65 66 DeleteManifests(names []string, opts *options.ManifestDeleteOpts) error 67 68 InspectManifest(name string, opts *options.ManifestInspectOpts) (*libimage.ManifestListData, error) 69 70 PushManifest(name, destSpec string, opts *options.PushOptions) error 71 72 AddToManifest(name string, imageNameOrIDList []string, opts *options.ManifestAddOpts) error 73 74 RemoveFromManifest(name string, instanceDigest digest.Digest, opts *options.ManifestRemoveOpts) error 75 }