Documentation ¶
Index ¶
- func RegisterAPIPlugin(ap APIPlugin)
- func RegisterContainerPlugin(cp ContainerPlugin)
- func RegisterCriPlugin(crip CriPlugin)
- func RegisterDaemonPlugin(dp DaemonPlugin)
- func RegisterImagePlugin(p ImagePlugin)
- func RegisterVolumePlugin(vp VolumePlugin)
- type APIPlugin
- type ContainerPlugin
- type CriPlugin
- type DaemonPlugin
- type ImagePlugin
- type VolumePlugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAPIPlugin ¶
func RegisterAPIPlugin(ap APIPlugin)
RegisterAPIPlugin is used to register api container.
func RegisterContainerPlugin ¶
func RegisterContainerPlugin(cp ContainerPlugin)
RegisterContainerPlugin is used to register container plugin.
func RegisterCriPlugin ¶
func RegisterCriPlugin(crip CriPlugin)
RegisterCriPlugin is used to register the cri plugin.
func RegisterDaemonPlugin ¶
func RegisterDaemonPlugin(dp DaemonPlugin)
RegisterDaemonPlugin is used to register daemon plugin.
func RegisterImagePlugin ¶
func RegisterImagePlugin(p ImagePlugin)
RegisterImagePlugin is used to register container plugin.
func RegisterVolumePlugin ¶
func RegisterVolumePlugin(vp VolumePlugin)
RegisterVolumePlugin is used to register the volume plugin.
Types ¶
type APIPlugin ¶
type APIPlugin interface { // UpdateHandler could register extra HTTP API to PouchContainer server, // change the behavior of the default handler. // The default handler of each API would be passed in while starting HTTP server. UpdateHandler(context.Context, []*types.HandlerSpec) []*types.HandlerSpec }
APIPlugin provides the ability to extend PouchContainer HTTP API and change how handler behave.
type ContainerPlugin ¶
type ContainerPlugin interface { // PreCreate defines plugin point where receives a container create request, in this plugin point user // could change the container create body passed-in by http request body PreCreate(context.Context, *types.ContainerCreateConfig) error // PreStart returns an array of priority and args which will pass to runc, the every priority // used to sort the pre start array that pass to runc, network plugin hook always has priority value 0. PreStart(context.Context, interface{}) ([]int, [][]string, error) // PreCreateEndpoint accepts the container id and env of this container, to update the config of container's endpoint. PreCreateEndpoint(context.Context, string, []string, *networktypes.Endpoint) error // PreUpdate defines plugin point where receives a container update request, in this plugin point user // could change the container update body passed-in by http request body PreUpdate(context.Context, io.ReadCloser) (io.ReadCloser, error) // PostUpdate called after update method successful, // the method accepts the rootfs path and envs of container PostUpdate(context.Context, string, []string) error }
ContainerPlugin defines places where a plugin will be triggered in container lifecycle
func GetContainerPlugin ¶
func GetContainerPlugin() ContainerPlugin
GetContainerPlugin returns the container plugin.
type CriPlugin ¶
type CriPlugin interface { // PreCreateContainer defines plugin point where receives a container create request, in this plugin point user // could update the container's config in cri interface. PreCreateContainer(context.Context, *types.ContainerCreateConfig, interface{}) error }
CriPlugin defines places where a plugin will be triggered in CRI api lifecycle
type DaemonPlugin ¶
type DaemonPlugin interface { // PreStartHook is invoked by pouch daemon before real start, in this hook user could start http proxy or other // standalone process plugins PreStartHook() error // PreStopHook is invoked by pouch daemon before daemon process exit, not a promise if daemon is killed, in this // hook user could stop the process or plugin started by PreStartHook PreStopHook() error }
DaemonPlugin defines places where a plugin will be triggered in pouchd lifecycle
func GetDaemonPlugin ¶
func GetDaemonPlugin() DaemonPlugin
GetDaemonPlugin returns the daemon plugin.
type ImagePlugin ¶
type ImagePlugin interface {
PostPull(ctx context.Context, snapshotter string, image containerd.Image) error
}
ImagePlugin defines places where a plugin will be triggered in image operations
func GetImagePlugin ¶
func GetImagePlugin() ImagePlugin
GetImagePlugin returns the container plugin.
type VolumePlugin ¶
type VolumePlugin interface { // PreVolumeCreate defines plugin point where receives an volume create request, in this plugin point user // could change the volume create body passed-in by http request body PreVolumeCreate(context.Context, *types.VolumeCreateConfig) error }
VolumePlugin defines places where a plugin will be triggered in volume lifecycle
func GetVolumePlugin ¶
func GetVolumePlugin() VolumePlugin
GetVolumePlugin returns the volume plugin.