cuecfg

package
v0.0.0-...-b872246 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Utilities for working with config files that rely on cue for validation and definition.

Index

Constants

View Source
const Indent = "  "

Variables

This section is empty.

Functions

func FileHash

func FileHash(path string) (string, error)

func Hash

func Hash(s any) (string, error)

func InitFile

func InitFile(path string, valuePtr any) (bool, error)

func IsSupportedExtension

func IsSupportedExtension(ext string) bool

func Marshal

func Marshal(valuePtr any, extension string) ([]byte, error)

func MarshalJSON

func MarshalJSON(v interface{}) ([]byte, error)

MarshalJSON marshals the given value to JSON. It does not HTML escape and adds standard indentation.

TODO: consider using cue's JSON marshaller instead of "encoding/json" ... it might have extra functionality related to the cue language.

func ParseFile

func ParseFile(path string, valuePtr any) error

func ParseFileWithExtension

func ParseFileWithExtension(path, ext string, valuePtr any) error

ParseFileWithExtension lets the caller override the extension of the `path` filename For example, project.csproj files should be treated as having extension .xml

func Unmarshal

func Unmarshal(data []byte, extension string, valuePtr any) error

func WriteFile

func WriteFile(path string, value any) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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