Documentation ¶
Overview ¶
Code generated by go generate; DO NOT EDIT.
Index ¶
Constants ¶
const ( // JSON is JSON file format. JSON = "JSON" // YAML if YAML file format. YAML = "YAML" )
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(fileContent *Content, opt RenderConfig) (*utils.OpaRawState, error)
Get process the fileContent and renders a RawState. IDs of entities are matches based on currentState.
func OpaStateToFile ¶
func OpaStateToFile(OpaState *state.OpaState, config WriteConfig) error
OpaStateToFile writes a state object to file with filename. It will omit timestamps and IDs while writing.
Types ¶
type Content ¶
type Content struct { FormatVersion string `json:"_format_version,omitempty" yaml:"_format_version,omitempty"` Policies []FPolicy `json:"policies,omitempty" yaml:",omitempty"` }
Content represents a serialized opa state.
func GetContentFromFile ¶
GetContentFromFile reads in a file with filename and constructs a state. If filename is `-`, then it will read from os.Stdin. If filename represents a directory, it will traverse the tree rooted at filename, read all the files with .yaml, .yml and .json extensions and generate a content after a merge of the content from all the files.
It will return an error if the file representation is invalid or if there is any error during processing.
type FPolicy ¶
FPolicy represents a opa Service and it's associated routes and plugins.
func (FPolicy) MarshalJSON ¶
MarshalJSON is a custom marshal method to handle foreign references.
func (FPolicy) MarshalYAML ¶
MarshalYAML is a custom marshal to handle SNI.
func (*FPolicy) UnmarshalJSON ¶
UnmarshalJSON is a custom marshal method to handle foreign references.
func (*FPolicy) UnmarshalYAML ¶
UnmarshalYAML is a custom marshal method to handle foreign references.
type RenderConfig ¶
RenderConfig contains necessary information to render a correct OpaConfig from a file.
type WriteConfig ¶
WriteConfig holds settings to use to write the state file.