dashboard_client

package
v0.6.1-nightly.f4248ba Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XAuthorization = "authorization"
	XContentType   = "content-type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	*Client
}

func (Api) All

func (Api) Create

func (a Api) Create(ctx context.Context, def *tykv1alpha1.APIDefinitionSpec) error

func (Api) Delete

func (a Api) Delete(ctx context.Context, id string) error

func (Api) Get

func (Api) Update

func (a Api) Update(ctx context.Context, def *tykv1alpha1.APIDefinitionSpec) error

type ApisResponse

type ApisResponse struct {
	Apis  []DashboardApi `json:"apis"`
	Pages int            `json:"pages"`
}

type Cert

type Cert struct {
	*Client
}

func (*Cert) All

func (c *Cert) All(ctx context.Context) ([]string, error)

All returns a list of all certificates ID's

func (*Cert) Delete

func (c *Cert) Delete(ctx context.Context, id string) error

func (*Cert) Exists

func (c *Cert) Exists(ctx context.Context, id string) bool

func (*Cert) Upload

func (c *Cert) Upload(ctx context.Context, key []byte, crt []byte) (id string, err error)

type CertErrorResponse

type CertErrorResponse struct {
	Status  string `json:"Status"`
	Message string `json:"Message"`
}

type CertResponse

type CertResponse struct {
	Id      string `json:"id"`
	Message string `json:"message"`
	Status  string `json:"status"`
}

type CertificateList

type CertificateList struct {
	CertIDs []string `json:"certs"`
	Pages   int      `json:"pages"`
}

type Client

type Client struct {
	universal_client.Client
}

func NewClient

func NewClient(log logr.Logger, env environmet.Env) *Client

func (*Client) Api

func (*Client) Certificate

func (c *Client) Certificate() universal_client.UniversalCertificate

func (*Client) HotReload

func (c *Client) HotReload() error

func (*Client) Organization

func (c *Client) Organization() universal_client.UniversalOrganization

func (*Client) SecurityPolicy

func (c *Client) SecurityPolicy() universal_client.UniversalSecurityPolicy

func (*Client) Webhook

type DashboardApi

type DashboardApi struct {
	CreatedAt     string               `json:"created_at,omitempty"`
	ApiDefinition v1.APIDefinitionSpec `json:"api_definition"`
}

type Organization

type Organization struct {
	*Client
}

func (*Organization) GetID

func (o *Organization) GetID() string

type PoliciesResponse

type PoliciesResponse struct {
	Policies []v1.SecurityPolicySpec `json:"data"`
	Pages    int                     `json:"pages"`
}

type ResponseMsg

type ResponseMsg struct {
	Key     string `json:"Key,omitempty"`
	Status  string `json:"Status,omitempty"`
	Action  string `json:"Action,omitempty"`
	Message string `json:"Message,omitempty"`
	Meta    string `json:"Meta,omitempty"`
}

type SecurityPolicy

type SecurityPolicy struct {
	*Client
}

func (SecurityPolicy) All

All Returns all policies from the Dashboard

func (SecurityPolicy) Create

Create creates a new policy using the def object

func (SecurityPolicy) Delete

func (p SecurityPolicy) Delete(ctx context.Context, id string) error

Delete deletes the resource by ID

func (SecurityPolicy) Get

Get find the Policy by id

func (SecurityPolicy) Update

Update updates a resource object def

type Webhook

type Webhook struct {
	*Client
}

func (Webhook) All

func (w Webhook) All() ([]v1.WebhookSpec, error)

* Returns all webhooks from the Dashboard for this org

func (Webhook) Create

func (w Webhook) Create(def *v1.WebhookSpec) error

Creates a webhook. Overwrites the Webhook "name" with the CRD's namespaced name

func (Webhook) Delete

func (w Webhook) Delete(id string) error

* Tries to delete a Webhook by first attempting to do a lookup on it. If webhook does not exist, move on, nothing to delete

func (Webhook) Get

func (w Webhook) Get(hookID string) (*v1.WebhookSpec, error)

*

Attempts to find the webhook by the namespaced name combo.
When creating a webhook, this is stored as the webhook's "name"

If no webhook found, return "universal_client.WebhookNotFoundError"

func (Webhook) Update

func (w Webhook) Update(def *v1.WebhookSpec) error

* Updates a Webhook. Adds the unique identifier namespaced-Name to the webhook's "name" so subsequent CRUD opps are possible.

type WebhookResponse

type WebhookResponse struct {
	Webhooks []v1.WebhookSpec `json:"hooks"`
	Pages    int              `json:"pages"`
}

Jump to

Keyboard shortcuts

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