file

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

type Parameter interface {
	// contains filtered or unexported methods
}

Parameter is the interface for service parameters.

func WithLogLevel

func WithLogLevel(logLevel zerolog.Level) Parameter

WithLogLevel sets the log level for the module.

type Service

type Service struct{}

Service returns the values from the filesystem. This service handles URLs with the scheme "file". It returns the file at the path as the value. For example a URL "direct:///home/me/secret.txt" will return the contents of the file "/home/me/secret.txt"

func New

func New(ctx context.Context, params ...Parameter) (*Service, error)

New creates a new file confidant.

func (*Service) Fetch

func (s *Service) Fetch(ctx context.Context, url *url.URL) ([]byte, error)

Fetch fetches a value given its file URL.

func (*Service) SupportedURLSchemes

func (s *Service) SupportedURLSchemes(ctx context.Context) ([]string, error)

SupportedURLSchemes provides the list of schemes supported by this confidant.

Jump to

Keyboard shortcuts

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