config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config provides utility functions for the sops-check.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(config *Config) error

Validate validates a configuration.

func ValidateRule

func ValidateRule(rule *Rule) error

ValidateRule validates a single rule.

Types

type Config

type Config struct {
	AllowUnmatched bool   `json:"allowUnmatched"`
	Rules          []Rule `json:"rules"`
}

Config represents the configuration for the sops-check.

func Load

func Load(filePath string) (*Config, error)

Load loads the configuration from a JSON file.

func LoadReader

func LoadReader(reader io.Reader) (*Config, error)

LoadReader loads the configuration from an io.Reader.

type Rule

type Rule struct {
	AllOf       []Rule `json:"allOf,omitempty"`
	AnyOf       []Rule `json:"anyOf,omitempty"`
	Match       string `json:"match,omitempty"`
	MatchRegex  string `json:"matchRegex,omitempty"`
	Not         *Rule  `json:"not,omitempty"`
	OneOf       []Rule `json:"oneOf,omitempty"`
	Description string `json:"description,omitempty"`
	URL         string `json:"url,omitempty"`
}

Rule represents a single rule in the configuration.

Jump to

Keyboard shortcuts

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