file

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 17

Documentation

Overview

Package file is the file source for orb/config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() source.Source

New creates a new file source for config.

func TempFile

func TempFile(data []byte, filetype string) *url.URL

TempFile will take a byte sequence and write it to a temporary file. This is useful if you want to parse a config from memory.

If at any point an erro occurs, it will panic. It does not return the error as the probability of one occurring is small, and now you can use it directly within your config array definition.

Example:

configSource := []config.Source{"config.yaml", file.TempFile(myConfig, "yaml")}

Types

type Source

type Source struct{}

Source is the file source for config.

func (*Source) PrependSections

func (s *Source) PrependSections() bool

PrependSections returns whetever this source needs sections to be prepended.

func (*Source) Read

func (s *Source) Read(u *url.URL) source.Data

func (*Source) Schemes

func (s *Source) Schemes() []string

Schemes returns the supported schemes for this source.

func (*Source) String

func (s *Source) String() string

String returns the name of the source.

Jump to

Keyboard shortcuts

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