opa

package
v2.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	Request *Request `json:"request"`
}

type Client

type Client struct {
	*httpclient.Client
	// contains filtered or unexported fields
}

func New

func New(host string) *Client

func NewDefault

func NewDefault() *Client

func (*Client) Evaluate

func (c *Client) Evaluate(query string, result interface{}, ig InputGenerator) error

Evaluate evaluates the query with the given input and return a json response which has a field called "result"

type HTTPSpec

type HTTPSpec struct {
	Method  string            `json:"method"`
	Headers map[string]string `json:"headers"`
}

type Input

type Input struct {
	ParsedQuery *ParseQuery `json:"parsed_query"`
	ParsedPath  []string    `json:"parsed_path"`
	Attributes  *Attributes `json:"attributes"`
}

type InputGenerator

type InputGenerator func() (*Input, error)

type ParseQuery

type ParseQuery struct {
	ProjectName []string `json:"projectName"`
}

type Request

type Request struct {
	HTTP *HTTPSpec `json:"http"`
}

Jump to

Keyboard shortcuts

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