hookdeck

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAPIBaseURL = "https://api.hookdeck.com"

DefaultAPIBaseURL is the default base URL for API requests

View Source
const DefaultConsoleBaseURL = "https://console.hookdeck.com"
View Source
const DefaultDashboardBaseURL = "https://dashboard.hookdeck.com"

DefaultDashboardBaseURL is the default base URL for dashboard requests

View Source
const DefaultDashboardURL = "https://dashboard.hookdeck.com"

DefaultDashboardURL is the default base URL for web links

View Source
const DefaultProfileName = "default"
View Source
const DefaultWebsocektURL = "wss://ws.hookdeck.com"

Variables

This section is empty.

Functions

This section is empty.

Types

type CIClient

type CIClient struct {
	Claimed  bool   `json:"claimed"`
	UserID   string `json:"user_id"`
	UserName string `json:"user_name"`
	TeamID   string `json:"team_id"`
	TeamName string `json:"team_name"`
	TeamMode string `json:"team_mode"`
	APIKey   string `json:"key"`
	ClientID string `json:"client_id"`
}

type CLITelemetry

type CLITelemetry struct {
	CommandPath       string `json:"command_path"`
	DeviceName        string `json:"device_name"`
	GeneratedResource bool   `json:"generated_resource"`
}

CLITelemetry is the structure that holds telemetry data sent to Hookdeck in API requests.

func GetTelemetryInstance

func GetTelemetryInstance() *CLITelemetry

GetTelemetryInstance returns the CLITelemetry instance (initializing it first if necessary).

func (*CLITelemetry) SetCommandContext

func (t *CLITelemetry) SetCommandContext(cmd *cobra.Command)

SetCommandContext sets the telemetry values for the command being executed.

func (*CLITelemetry) SetDeviceName

func (t *CLITelemetry) SetDeviceName(deviceName string)

SetDeviceName puts the device name into telemetry

type Client

type Client struct {
	// The base URL (protocol + hostname) used for all requests sent by this
	// client.
	BaseURL *url.URL

	// API key used to authenticate requests sent by this client. If left
	// empty, the `Authorization` header will be omitted.
	APIKey string

	TeamID string

	// When this is enabled, request and response headers will be printed to
	// stdout.
	Verbose bool
	// contains filtered or unexported fields
}

Client is the API client used to sent requests to Hookdeck.

func (*Client) CreateCIClient

func (c *Client) CreateCIClient(input CreateCIClientInput) (CIClient, error)

func (*Client) CreateConnection added in v0.5.1

func (c *Client) CreateConnection(input CreateConnectionInput) (Connection, error)

func (*Client) CreateGuestUser

func (c *Client) CreateGuestUser(input CreateGuestUserInput) (GuestUser, error)

func (*Client) CreateSession

func (c *Client) CreateSession(input CreateSessionInput) (Session, error)

func (*Client) CreateSource added in v0.5.1

func (c *Client) CreateSource(input CreateSourceInput) (Source, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, params string, configure func(*http.Request)) (*http.Response, error)

func (*Client) GetSourceByAlias added in v0.5.1

func (c *Client) GetSourceByAlias(alias string) (Source, error)

func (*Client) ListConnectionsBySource added in v0.5.1

func (c *Client) ListConnectionsBySource(source_id string) ([]Connection, error)

func (*Client) ListSources added in v0.5.1

func (c *Client) ListSources() ([]Source, error)

func (*Client) ListWorkspaces added in v0.8.0

func (c *Client) ListWorkspaces() ([]Workspace, error)

func (*Client) PerformRequest

func (c *Client) PerformRequest(ctx context.Context, req *http.Request) (*http.Response, error)

PerformRequest sends a request to Hookdeck and returns the response.

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, data []byte, configure func(*http.Request)) (*http.Response, error)

func (*Client) Put

func (c *Client) Put(ctx context.Context, path string, data []byte, configure func(*http.Request)) (*http.Response, error)

type Connection added in v0.5.1

type Connection struct {
	Id          string
	Alias       string
	Label       string
	Destination Destination
}

type ConnectionList added in v0.5.1

type ConnectionList struct {
	Count  int
	Models []Connection
}

type CreateCIClientInput

type CreateCIClientInput struct {
	DeviceName string `json:"device_name"`
}

type CreateConnectionInput added in v0.5.1

type CreateConnectionInput struct {
	Alias       string                 `json:"alias"`
	Label       string                 `json:"label"`
	SourceId    string                 `json:"source_id"`
	Destination CreateDestinationInput `json:"destination"`
}

type CreateDestinationInput added in v0.5.1

type CreateDestinationInput struct {
	Alias   string `json:"alias"`
	Label   string `json:"label"`
	CliPath string `json:"cli_path"`
}

type CreateGuestUserInput

type CreateGuestUserInput struct {
	DeviceName string `json:"device_name"`
}

type CreateSessionInput

type CreateSessionInput struct {
	SourceId      string   `json:"source_id"`
	ConnectionIds []string `json:"webhook_ids"`
}

type CreateSourceInput added in v0.5.1

type CreateSourceInput struct {
	Alias string `json:"alias"`
	Label string `json:"label"`
}

type Destination added in v0.5.1

type Destination struct {
	Id      string `json:"id"`
	Alias   string `json:"alias"`
	Label   string `json:"label"`
	CliPath string `json:"cli_path"`
}

type ErrorResponse

type ErrorResponse struct {
	Handled bool   `json:"Handled"`
	Message string `json:"message"`
}

type GuestUser

type GuestUser struct {
	Id         string `json:"id"`
	APIKey     string `json:"key"`
	Url        string `json:"link"`
	BrowserURL string `json:"browser_url"`
	PollURL    string `json:"poll_url"`
}

type Session

type Session struct {
	Id string
}

type Source added in v0.5.1

type Source struct {
	Id    string
	Alias string
	Label string
	Url   string
}

type SourceList added in v0.5.1

type SourceList struct {
	Count  int
	Models []Source
}

type Workspace added in v0.8.0

type Workspace struct {
	Id   string
	Name string
	Mode string
}

Jump to

Keyboard shortcuts

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