Documentation
¶
Index ¶
Constants ¶
View Source
const ( TagsAction = "tags" ExecuteAction = "execute" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractClient ¶
type AbstractClient interface {
GenerateTags(input interface{}) ([]amphora.Tag, error)
CanExecute(input interface{}) (bool, error)
}
AbstractClient is an interface that defines the methods that an OPA client must implement.
type Client ¶
type Client struct {
URL url.URL
PolicyPackage string
HttpClient http.Client
Logger *zap.SugaredLogger
}
Client represents an OPA client that can be used to interact with an OPA server.
func NewClient ¶
NewClient creates a new OPA client with the given endpoint and policy package. It returns an error if the endpoint is invalid or the policy package is empty.
func (*Client) CanExecute ¶
CanExecute checks if the program can be executed with the input described by the data provided according to the policy package. It returns true if the program can be executed, false otherwise. An error is returned if the request fails.
type ExecuteResponse ¶
type ExecuteResponse struct {
IsAllowed bool `json:"result"`
}
type OpaRequest ¶
type OpaRequest struct {
Input interface{} `json:"input"`
}
type TagResponse ¶
Click to show internal directories.
Click to hide internal directories.