das

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sanitize

func Sanitize(name string) string

Types

type Client

type Client struct {
	URL     string
	Token   string
	Headers []string
	Client  *http.Client
}

func (*Client) Get

func (c *Client) Get(path string, params ...Params) (*http.Response, error)

func (*Client) JSON

func (c *Client) JSON(path string, params ...Params) (*Response, error)

type Error

type Error struct {
	URL        string
	Method     string
	StatusCode int
}

func (Error) Error

func (e Error) Error() string

type Params

type Params struct {
	Query map[string]string
}

type Response

type Response struct {
	Result    json.RawMessage `json:"result"`
	RequestId string          `json:"request_id"`
}

func (*Response) Decode

func (r *Response) Decode(x any) error

type V1Bundle

type V1Bundle struct {
	Id          string  `json:"id"`
	Active      float64 `json:"active"`
	DownloadURL string  `json:"download_url"`
	SBOM        struct {
		Origins []struct {
			Id     string   `json:"id"`
			Commit string   `json:"commit"`
			Roots  []string `json:"roots"`
		} `json:"origins"`
	} `json:"sbom"`
}

type V1Datasource

type V1Datasource struct {
	Id       string `json:"id"`
	Category string `json:"category"`
	Type     string `json:"type"`
	URL      string `json:"url"`
	Headers  []struct {
		Name     string  `json:"name"`
		Value    *string `json:"value"` // either value or secret_id should be set
		SecretId *string `json:"secret_id"`
	} `json:"headers"`
}

type V1DatasourceRef

type V1DatasourceRef struct {
	Id string `json:"id"`
}

type V1Decision

type V1Decision struct {
	DecisionId string `json:"decision_id"`
	Bundles    map[string]struct {
		Revision string `json:"revision"`
	} `json:"bundles"`
	Path    string `json:"path"`
	Input   *any   `json:"input"`
	Result  *any   `json:"result"`
	Metrics struct {
		TimerRegoQueryCompileNs int64 `json:"timer_rego_query_compile_ns"`
		TimerRegoQueryEvalNs    int64 `json:"timer_rego_query_eval_ns"`
		TimerReqoQueryParseNs   int64 `json:"timer_rego_query_parse_ns"`
	} `json:"metrics"`
}

type V1Decisions

type V1Decisions struct {
	Items []V1Decision `json:"items"`
}

type V1GitRepoConfig

type V1GitRepoConfig struct {
	Commit         string `json:"commit"`
	Path           string `json:"path"`
	Reference      string `json:"reference"`
	Credentials    string `json:"credentials"`
	SSHCredentials struct {
		Passphrase string `json:"passphrase"`
		PrivateKey string `json:"private_key"`
	} `json:"ssh_credentials"`
	URL string `json:"url"`
}

type V1Library

type V1Library struct {
	Id            string                  `json:"id"`
	Policies      []V1PoliciesRef         `json:"policies"`
	SourceControl *V1LibrarySourceControl `json:"source_control"`
	Datasources   []V1DatasourceRef       `json:"datasources"`
}

func (*V1Library) SanitizedName

func (v1 *V1Library) SanitizedName() string

type V1LibrarySourceControl

type V1LibrarySourceControl struct {
	UseWorkspaceSettings bool            `json:"use_workspace_settings"`
	Origin               V1GitRepoConfig `json:"origin"`
	LibraryOrigin        V1GitRepoConfig `json:"library_origin"`
}

type V1PoliciesRef

type V1PoliciesRef struct {
	Id string `json:"id"`
}

type V1Policy

type V1Policy struct {
	Package  string            `json:"package"`
	Modules  map[string]string `json:"modules"`
	Packages []string          `json:"packages"`
}

type V1Stack

type V1Stack struct {
	Id            string          `json:"id"`
	Name          string          `json:"name"`
	Type          string          `json:"type"`
	Policies      []V1PoliciesRef `json:"policies"`
	SourceControl *struct {
		UseWorkspaceSettings bool            `json:"use_workspace_settings"`
		Origin               V1GitRepoConfig `json:"origin"`
		StackOrigin          V1GitRepoConfig `json:"stack_origin"`
	} `json:"source_control"`
	Datasources     []V1DatasourceRef `json:"datasources"`
	MatchingSystems []string          `json:"matching_systems"`
}

func (*V1Stack) SanitizedName

func (v1 *V1Stack) SanitizedName() string

type V1System

type V1System struct {
	Id            string          `json:"id"`
	Name          string          `json:"name"`
	Type          string          `json:"type"`
	Policies      []V1PoliciesRef `json:"policies"`
	SourceControl *struct {
		Origin V1GitRepoConfig `json:"origin"`
	} `json:"source_control"`
	Datasources    []V1DatasourceRef `json:"datasources"`
	BundleRegistry struct {
		ManualDeployment bool `json:"manual_deployment"`
	} `json:"bundle_registry"`
	MatchingStacks []string `json:"matching_stacks"`
}

func (*V1System) SanitizedName

func (v1 *V1System) SanitizedName() string

Jump to

Keyboard shortcuts

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