sdk

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerList = []string{
	"https://TENANT.styra.com/",

	"https://{dasId}.styra.com",
}

ServerList contains the list of servers available to the SDK

Functions

func Bool

func Bool(b bool) *bool

Bool provides a helper function to return a pointer to a bool

func Float32

func Float32(f float32) *float32

Float32 provides a helper function to return a pointer to a float32

func Float64

func Float64(f float64) *float64

Float64 provides a helper function to return a pointer to a float64

func Int

func Int(i int) *int

Int provides a helper function to return a pointer to an int

func Int64

func Int64(i int64) *int64

Int64 provides a helper function to return a pointer to an int64

func String

func String(s string) *string

String provides a helper function to return a pointer to a string

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for suplying the SDK with a custom HTTP client

type Libraries

type Libraries struct {
	// contains filtered or unexported fields
}

Libraries - API to create and manage libraries

func (*Libraries) LibrariesDelete

LibrariesDelete - Delete a library

func (*Libraries) LibrariesGet

LibrariesGet - Get a library

func (*Libraries) LibrariesUpdate

LibrariesUpdate - Upsert a new library

type Policies

type Policies struct {
	// contains filtered or unexported fields
}

Policies - Policy management

func (*Policies) DeletePolicy

DeletePolicy - Delete a policy

func (*Policies) GetPolicy

GetPolicy - Get a policy

func (*Policies) UpdatePolicy

UpdatePolicy - Update a policy

type SDKOption

type SDKOption func(*StyraDas)

func WithClient

func WithClient(client HTTPClient) SDKOption

WithClient allows the overriding of the default HTTP client used by the SDK

func WithDasID

func WithDasID(dasID string) SDKOption

WithDasID allows setting the dasId variable for url substitution

func WithRetryConfig

func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption

func WithSecurity

func WithSecurity(security shared.Security) SDKOption

WithSecurity configures the SDK to use the provided security details

func WithSecuritySource

func WithSecuritySource(security func(context.Context) (shared.Security, error)) SDKOption

WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication

func WithServerIndex

func WithServerIndex(serverIndex int) SDKOption

WithServerIndex allows the overriding of the default server by index

func WithServerURL

func WithServerURL(serverURL string) SDKOption

WithServerURL allows the overriding of the default server URL

func WithTemplatedServerURL

func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption

WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters

type Secrets

type Secrets struct {
	// contains filtered or unexported fields
}

Secrets Management

func (*Secrets) CreateUpdateSecret

CreateUpdateSecret - Create/update secret

func (*Secrets) DeleteSecret

DeleteSecret - Delete secret

func (*Secrets) GetSecret

GetSecret - Get secret

type Stacks

type Stacks struct {
	// contains filtered or unexported fields
}

Stacks management

func (*Stacks) CreateStack

CreateStack - Create a stack

func (*Stacks) DeleteStack

DeleteStack - Delete a stack

func (*Stacks) GetStack

GetStack - Get a stack configuration

func (*Stacks) UpdateStack

UpdateStack - Create or update a stack. Only the fields sent in the request are updated

type StyraDas

type StyraDas struct {
	// API to create and manage libraries
	Libraries *Libraries
	// Policy management
	Policies *Policies
	// Secrets Management
	Secrets *Secrets
	// Stacks management
	Stacks *Stacks
	// Systems management
	Systems *Systems
	// contains filtered or unexported fields
}

StyraDas - Styra API: Styra DAS is entirely API-driven.

Access to the APIs requires authentication that should be provided as an Authorization HTTP header including a Styra DAS-issued token:

`Authorization: Bearer <YOURTOKENHERE>`

To request a token you need to have an Styra account, and create a token via the API Tokens menu.

https://docs.styra.com - Styra DAS Documentation

func New

func New(opts ...SDKOption) *StyraDas

New creates a new instance of the SDK with the provided options

type Systems

type Systems struct {
	// contains filtered or unexported fields
}

Systems management

func (*Systems) CreateSystem

CreateSystem - Create a system

func (*Systems) DeleteSystem

DeleteSystem - Delete a system

func (*Systems) GetSystem

GetSystem - Get a system

func (*Systems) UpdateSystem

UpdateSystem - Update or create a system. Only the fields sent in the request are updated * Updating the given system with type-specific related objects, except changing the system's type. * Creating a system with given ID with type-specific related objects, only, if the `If-None-Match` header is set to `*`

Example:
  ```shell
  curl -H "Authorization: Bearer <token>" \
       -H "Styra-Tenant: <tenant>" \
       -H "If-None-Match: *" \
       -X PUT https://<das-id>.styra.com
       -d '{<request body>}'
  ```

Directories

Path Synopsis
internal
models

Jump to

Keyboard shortcuts

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