create

package
v0.125.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 27 Imported by: 2

Documentation

Overview

Package create contains functions for to create Resource objects. This will typically non-files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client contains methods to create Resource objects. tasks to Resource objects.

func New

func New(rs *resources.Spec) *Client

New creates a new Client with the given specification.

func (*Client) ByType added in v0.97.0

func (c *Client) ByType(tp string) resource.Resources

func (*Client) Copy added in v0.100.0

func (c *Client) Copy(r resource.Resource, targetPath string) (resource.Resource, error)

Copy copies r to the new targetPath.

func (*Client) FromRemote added in v0.90.0

func (c *Client) FromRemote(uri string, optionsm map[string]any) (resource.Resource, error)

FromRemote expects one or n-parts of a URL to a resource If you provide multiple parts they will be joined together to the final URL.

func (*Client) FromString

func (c *Client) FromString(targetPath, content string) (resource.Resource, error)

FromString creates a new Resource from a string with the given relative target path. TODO(bep) see #10912; we currently emit a warning for this config scenario.

func (*Client) Get

func (c *Client) Get(pathname string) (resource.Resource, error)

Get creates a new Resource by opening the given pathname in the assets filesystem.

func (*Client) GetMatch added in v0.57.0

func (c *Client) GetMatch(pattern string) (resource.Resource, error)

GetMatch gets first resource matching the given pattern from the assets filesystem.

func (*Client) Match added in v0.57.0

func (c *Client) Match(pattern string) (resource.Resources, error)

Match gets the resources matching the given pattern from the assets filesystem.

type HTTPError added in v0.96.0

type HTTPError struct {
	Data map[string]any

	StatusCode int
	Body       string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL