location

package
v0.74.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *Resource)

func WithCredentials

func WithCredentials(cred string) Option

type Resource

type Resource struct {
	URL         string            `description:"resource URL or relative or absolute path" required:"true" yaml:",omitempty"` //URL of resource
	Credentials string            `description:"credentials file" yaml:",omitempty"`                                          //name of credential file or credential key depending on implementation
	CustomKey   *option.AES256Key `description:" content encryption key" yaml:",omitempty"`
	Key         string            `description:" secret key"  yaml:",omitempty"`
}

Resource represents

func NewResource

func NewResource(URL string, opts ...Option) *Resource

func (*Resource) Clone

func (r *Resource) Clone() *Resource

func (*Resource) CredentialURL

func (r *Resource) CredentialURL(username, password string) string

CredentialURL returns url's with provided credential

func (*Resource) Decode

func (r *Resource) Decode(request interface{}) error

func (*Resource) DecodeWith

func (r *Resource) DecodeWith(ctx context.Context, fs afs.Service, target interface{}, decoderFactory toolbox.DecoderFactory) error

func (*Resource) DecoderFactory

func (r *Resource) DecoderFactory() toolbox.DecoderFactory

Resource

func (*Resource) DownloadBase64

func (r *Resource) DownloadBase64(ctx context.Context, fs afs.Service) (string, error)

DownloadBase64 loads base64 resource content

func (*Resource) DownloadText

func (r *Resource) DownloadText() (string, error)

func (*Resource) Host

func (r *Resource) Host() string

Host return hostname[:port]

func (*Resource) Hostname

func (r *Resource) Hostname() string

Hostname return hostname

func (*Resource) JSONDecode

func (r *Resource) JSONDecode(ctx context.Context, fs afs.Service, target interface{}) error

JSONDecode decodes json resource into target

func (*Resource) Join

func (r *Resource) Join(uri string) *Resource

func (*Resource) Path

func (r *Resource) Path() string

func (*Resource) Port

func (r *Resource) Port() string

func (*Resource) Rename

func (r *Resource) Rename(name string)

func (*Resource) Scheme

func (r *Resource) Scheme() string

func (*Resource) YAMLDecode

func (r *Resource) YAMLDecode(ctx context.Context, fs afs.Service, target interface{}) error

JSONDecode decodes yaml resource into target

Jump to

Keyboard shortcuts

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