cfg

package
v0.0.0-...-00a1a7c Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Provides utilities to help create and update project config files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PointerToMap

func PointerToMap(ptr string, v interface{}) (mp map[string]interface{})

Types

type File

type File struct {
	Path string
	Data map[string]interface{}
}

func ReadBytes

func ReadBytes(content []byte, p string, ts ...string) (*File, error)

func ReadFile

func ReadFile(p string, t ...string) (*File, error)

func (*File) MergeMap

func (f *File) MergeMap(
	m map[string]interface{},
	o ...func(*mergo.Config),
) error

func (*File) MergeSource

func (f *File) MergeSource(srcs ...*Source) error

type Source

type Source struct {
	File    *File
	Options []func(*mergo.Config)
}

func ReadSourceBytes

func ReadSourceBytes(
	d []byte,
	p string,
	o ...func(*mergo.Config),
) (*Source, error)

func ReadSourceFile

func ReadSourceFile(p string, o ...func(*mergo.Config)) (*Source, error)

Jump to

Keyboard shortcuts

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