Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Pull(ctx context.Context, ref string, middlewares ...OptPullPush) (*Image, error)
- func (c *Client) PullToFile(ref, filename string, middlewares ...OptPullPush) (*Image, error)
- func (c *Client) Push(ctx context.Context, ref, filename string, moduleContent []byte, ...) (*Image, error)
- func (c *Client) PushFromFile(ref, modulePath string, middlewares ...OptPullPush) error
- type Image
- type OptPullPush
Constants ¶
View Source
const ( // MediaTypeWasmContentLayer content layer media type MediaTypeWasmContentLayer = "application/vnd.wasm.content.layer.v1+wasm" // MediaTypeWasmConfig config media type MediaTypeWasmConfig = "application/vnd.wasm.config.v1+json" // AnnotationWasmTitle filename of webassembly, such as example.wasm AnnotationWasmTitle = "org.wasmerd.wasm.title" )
Thanks to https://github.com/engineerd/wasm-to-oci
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client OCI client
func (*Client) PullToFile ¶
func (c *Client) PullToFile(ref, filename string, middlewares ...OptPullPush) (*Image, error)
PullToFile Pull and write to file system
func (*Client) Push ¶
func (c *Client) Push(ctx context.Context, ref, filename string, moduleContent []byte, middlewares ...OptPullPush) (*Image, error)
Push pushes a WASM module to an OCI registry
func (*Client) PushFromFile ¶
func (c *Client) PushFromFile(ref, modulePath string, middlewares ...OptPullPush) error
PushFromFile push to registry from file in file system
type Image ¶
type Image struct { // Name of the webassembly image. // // To be pulled, it must be a reference compatible with resolvers. Name string // Labels provide runtime decoration for the image record. // // There is no default behavior for how these labels are propagated. They // only decorate the static metadata object. // This field is optional. Labels map[string]string // Manifest describes the root content for this image. Typically, this is // a manifest, index or manifest list. Manifest v1.Descriptor // Webassembly describes the webassembly layer content for this image. Webassembly v1.Descriptor // Content describes webassembly file content. Content []byte CreatedAt, UpdatedAt time.Time }
Image is the OCI Image
type OptPullPush ¶
type OptPullPush func(o *options) error
OptPullPush options for pull/push
func WithHandleLayerDesc ¶
func WithHandleLayerDesc(save func(layer v1.Descriptor)) OptPullPush
WithHandleLayerDesc sets the allowed media types
func WithHandleManifestDesc ¶
func WithHandleManifestDesc(save func(manifest v1.Descriptor)) OptPullPush
WithHandleManifestDesc sets the allowed media types
func WithNetworkConfig ¶
func WithNetworkConfig(insecure, plainHTTP bool) OptPullPush
WithNetworkConfig sets the allowed media types
func WithRegistryConfig ¶
func WithRegistryConfig(insecure, plainHTTP bool) OptPullPush
WithRegistryConfig sets the allowed media types
Click to show internal directories.
Click to hide internal directories.