github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/build/buildimage/image_interface.go (about)

     1  // Copyright © 2021 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 buildimage
    16  
    17  import (
    18  	v1 "github.com/alibaba/sealer/types/api/v1"
    19  )
    20  
    21  type Executor interface {
    22  	// Execute all raw layers,and merge with base layers.
    23  	Execute(ctx Context, rawLayers []v1.Layer) ([]v1.Layer, error)
    24  	Cleanup() error
    25  }
    26  
    27  type Differ interface {
    28  	// Process :diff changes by build-in handler and save to dst,like pull docker image from manifests or helm charts
    29  	//diff Metadata file changes save to the base layer.generally dst is the rootfs.
    30  	Process(srcPath, rootfs string) error
    31  }
    32  
    33  type ImageSetter interface {
    34  	// Set :fill up v1.image struct, like image annotations, platform and so on.
    35  	Set(*v1.Image) error
    36  }
    37  
    38  type ImageSaver interface {
    39  	// Save with image attribute,and register to image metadata.
    40  	Save(image *v1.Image) error
    41  }