create

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

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

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

func (*Client) Copy

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

Copy copies r to the new targetPath.

func (*Client) FromRemote

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(filename string) (resource.Resource, error)

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

func (*Client) GetMatch

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

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

func (*Client) Match

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

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

type HTTPError

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