opa

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decision

type Decision struct {
	Allowed  bool     `json:"allowed"`
	Denials  []string `json:"denials,omitempty"`
	Carriers []string `json:"carriers,omitempty"`
}

Decision should be called at a /decision endpoint.

type Driver

type Driver struct {
	ID         string   `json:"id"`
	Experience int      `json:"experience"`
	Age        int      `json:"age"`
	AVDs       []string `json:"avds"`
}

type Input

type Input struct {
	State       string    `json:"state"`
	Operation   string    `json:"operation"`
	Commodities []string  `json:"commodities"`
	Drivers     []Driver  `json:"drivers"`
	Vehicles    []Vehicle `json:"vehicles"`
	Trailers    []Trailer `json:"trailers"`
}

type OPARequest

type OPARequest struct {
	Input Input `json:"input"`
}

type OPAResponse

type OPAResponse struct {
	Result Result `json:"result"`
}

type OPAURL

type OPAURL string
const (
	SideCarOPA OPAURL = "http://localhost:8181"
	CentralOPA OPAURL = "http://opa.svc.cluster.local:8181"
)

type Result

type Result struct {
	Allow bool     `json:"allow"`
	Deny  []string `json:"deny,omitempty"`
}

type Trailer

type Trailer struct {
	ID          string `json:"id"`
	TrailerType string `json:"trailer_type"`
	ModelYear   int    `json:"model_year"`
	Amount      int    `json:"amount"`
}

type Vehicle

type Vehicle struct {
	ID        string `json:"id"`
	BodyType  string `json:"body_type"`
	Class     int    `json:"class"`
	ModelYear int    `json:"model_year"`
	Amount    int    `json:"amount"`
}

Jump to

Keyboard shortcuts

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