configmanager

package
v0.0.0-...-72e33f6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Merge

func Merge(json string, values []MergeValues) (string, error)

Merge merges values into the json. Values are only merged if the path already exists in the original json.

func SetConfig

func SetConfig[T ConfigData](ctx context.Context, c dahuarpc.Conn, config Config[T]) error

Types

type Config

type Config[T ConfigData] struct {
	Tables []ConfigTable[T]
	// contains filtered or unexported fields
}

func GetConfig

func GetConfig[T ConfigData](ctx context.Context, c dahuarpc.Conn, name string, array bool) (Config[T], error)

type ConfigData

type ConfigData interface {
	Merge(js string) (string, error)
	Validate() error
}

type ConfigTable

type ConfigTable[T ConfigData] struct {
	Data T
	JSON json.RawMessage
}

type MergeValues

type MergeValues struct {
	Path  string
	Value any
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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