edge

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACP

type ACP struct {
	ID          string `json:"id"`
	WorkspaceID string `json:"workspaceId"`
	ClusterID   string `json:"clusterId"`

	Version string `json:"version"`

	Name       string            `json:"name"`
	JWT        *jwt.Config       `json:"jwt"`
	BasicAuth  *basicauth.Config `json:"basicAuth"`
	OIDC       *oidc.Config      `json:"oidc"`
	OIDCGoogle *OIDCGoogle       `json:"oidcGoogle"`

	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

ACP is an Access Control Policy definition.

type ACPInfo

type ACPInfo struct {
	Name string `json:"name"`
}

ACPInfo represents an ACP for an Ingress.

type APIError

type APIError struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"error"`
}

APIError represents an error returned by the API.

func (APIError) Error

func (a APIError) Error() string

type Client

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

Client allows interacting with the cluster service.

func NewClient

func NewClient(baseURL, token string) (*Client, error)

NewClient creates a new client for the cluster service.

func (*Client) GetACPs

func (c *Client) GetACPs(ctx context.Context) ([]ACP, error)

GetACPs returns the ACPs related to the agent.

func (*Client) GetEdgeIngresses

func (c *Client) GetEdgeIngresses(ctx context.Context) ([]Ingress, error)

GetEdgeIngresses returns the EdgeIngresses related to the agent.

type Domain added in v0.8.0

type Domain struct {
	Name     string `json:"name"`
	Verified bool   `json:"verified"`
}

Domain holds domain information.

type FileOrContent

type FileOrContent string

FileOrContent hold a file path or content.

func (FileOrContent) IsPath

func (f FileOrContent) IsPath() bool

IsPath returns true if the FileOrContent is a file path, otherwise returns false.

func (FileOrContent) Read

func (f FileOrContent) Read() ([]byte, error)

func (FileOrContent) String

func (f FileOrContent) String() string

type Ingress

type Ingress struct {
	ID string `json:"id"`

	WorkspaceID string `json:"workspaceId"`
	ClusterID   string `json:"clusterId"`
	Namespace   string `json:"namespace"`
	Name        string `json:"name"`

	Domain        string   `json:"domain"`
	CustomDomains []Domain `json:"customDomains"`
	Service       Service  `json:"service"`
	ACP           *ACPInfo `json:"acp,omitempty"`

	Version   string    `json:"version"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

Ingress represents an edge ingress configuration on a cluster.

type Listener

type Listener func(context.Context, []Ingress, []ACP) error

Listener listens the changes of the edge related elements.

type OIDCGoogle added in v0.9.0

type OIDCGoogle struct {
	oidc.Config

	Emails []string `json:"emails,omitempty"`
}

OIDCGoogle is the Google OIDC configuration.

type Service

type Service struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Network string `json:"network"`
	Port    int    `json:"port"`
}

Service represents an endpoint for an Ingress.

type Watcher

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

Watcher watches hub agent configuration.

func NewWatcher

func NewWatcher(c *Client, interval time.Duration) *Watcher

NewWatcher return a new Watcher.

func (*Watcher) AddListener

func (w *Watcher) AddListener(listener Listener)

AddListener adds a listener.

func (*Watcher) Run

func (w *Watcher) Run(ctx context.Context)

Run runs ConfigWatcher.

Jump to

Keyboard shortcuts

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