Discover Packages
github.com/CoverWhale/coverwhale-go
opa
package
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: May 23, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
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 struct {
ID string `json:"id"`
Experience int `json:"experience"`
Age int `json:"age"`
AVDs []string `json:"avds"`
}
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 struct {
Input Input `json:"input"`
}
type OPAResponse struct {
Result Result `json:"result"`
}
const (
SideCarOPA OPAURL = "http://localhost:8181"
CentralOPA OPAURL = "http://opa.svc.cluster.local:8181"
)
type Result struct {
Allow bool `json:"allow"`
Deny []string `json:"deny,omitempty"`
}
type Trailer struct {
ID string `json:"id"`
TrailerType string `json:"trailer_type"`
ModelYear int `json:"model_year"`
Amount int `json:"amount"`
}
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"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.