hookdeck

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 22 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

func CreateSDKClient

func CreateSDKClient(init SDKClientInit) *hookdeckclient.Client

Types

type CIClient

type CIClient struct {
	Claimed          bool   `json:"claimed"`
	UserID           string `json:"user_id"`
	UserName         string `json:"user_name"`
	OrganizationName string `json:"organization_name"`
	OrganizationID   string `json:"organization_id"`
	ProjectID        string `json:"team_id"`
	ProjectName      string `json:"team_name"`
	ProjectMode      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

	ProjectID string

	// When this is enabled, request and response headers will be printed to
	// stdout.
	Verbose bool

	// When this is enabled, HTTP 429 (rate limit) errors will be logged at
	// DEBUG level instead of ERROR level. Useful for polling scenarios where
	// rate limiting is expected.
	SuppressRateLimitErrors bool
	// contains filtered or unexported fields
}

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

func (*Client) CountConnections added in v1.2.0

func (c *Client) CountConnections(ctx context.Context, params map[string]string) (*ConnectionCountResponse, error)

CountConnections counts connections matching the given filters

func (*Client) CreateCIClient

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

func (*Client) CreateConnection added in v0.5.1

func (c *Client) CreateConnection(ctx context.Context, req *ConnectionCreateRequest) (*Connection, error)

CreateConnection creates a new connection

func (*Client) CreateGuestUser

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

func (*Client) CreateSession

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

func (*Client) DeleteConnection added in v1.2.0

func (c *Client) DeleteConnection(ctx context.Context, id string) error

DeleteConnection deletes a connection

func (*Client) DisableConnection added in v1.2.0

func (c *Client) DisableConnection(ctx context.Context, id string) (*Connection, error)

DisableConnection disables a connection

func (*Client) EnableConnection added in v1.2.0

func (c *Client) EnableConnection(ctx context.Context, id string) (*Connection, error)

EnableConnection enables a connection

func (*Client) Get

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

func (*Client) GetConnection added in v1.2.0

func (c *Client) GetConnection(ctx context.Context, id string) (*Connection, error)

GetConnection retrieves a single connection by ID

func (*Client) ListConnections added in v1.2.0

func (c *Client) ListConnections(ctx context.Context, params map[string]string) (*ConnectionListResponse, error)

ListConnections retrieves a list of connections with optional filters

func (*Client) ListProjects

func (c *Client) ListProjects() ([]Project, error)

func (*Client) PauseConnection added in v1.2.0

func (c *Client) PauseConnection(ctx context.Context, id string) (*Connection, error)

PauseConnection pauses a connection

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)

func (*Client) UnpauseConnection added in v1.2.0

func (c *Client) UnpauseConnection(ctx context.Context, id string) (*Connection, error)

UnpauseConnection unpauses a connection

func (*Client) UpsertConnection added in v1.2.0

func (c *Client) UpsertConnection(ctx context.Context, req *ConnectionCreateRequest) (*Connection, error)

UpsertConnection creates or updates a connection by name Uses PUT /connections endpoint with name as the unique identifier

type Connection added in v0.5.1

type Connection struct {
	ID          string       `json:"id"`
	Name        *string      `json:"name"`
	FullName    *string      `json:"full_name"`
	Description *string      `json:"description"`
	TeamID      string       `json:"team_id"`
	Destination *Destination `json:"destination"`
	Source      *Source      `json:"source"`
	Rules       []Rule       `json:"rules"`
	DisabledAt  *time.Time   `json:"disabled_at"`
	PausedAt    *time.Time   `json:"paused_at"`
	UpdatedAt   time.Time    `json:"updated_at"`
	CreatedAt   time.Time    `json:"created_at"`
}

Connection represents a Hookdeck connection

type ConnectionCountResponse added in v1.2.0

type ConnectionCountResponse struct {
	Count int `json:"count"`
}

ConnectionCountResponse represents the response from counting connections

type ConnectionCreateRequest added in v1.2.0

type ConnectionCreateRequest struct {
	Name          *string                 `json:"name,omitempty"`
	Description   *string                 `json:"description,omitempty"`
	SourceID      *string                 `json:"source_id,omitempty"`
	DestinationID *string                 `json:"destination_id,omitempty"`
	Source        *SourceCreateInput      `json:"source,omitempty"`
	Destination   *DestinationCreateInput `json:"destination,omitempty"`
	Rules         []Rule                  `json:"rules,omitempty"`
}

ConnectionCreateRequest represents the request to create a connection

type ConnectionListResponse added in v1.2.0

type ConnectionListResponse struct {
	Models     []Connection       `json:"models"`
	Pagination PaginationResponse `json:"pagination"`
}

ConnectionListResponse represents the response from listing connections

type CreateCIClientInput

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

type CreateGuestUserInput

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

type CreateSessionInput

type CreateSessionInput struct {
	ConnectionIds []string        `json:"webhook_ids"`
	Filters       *SessionFilters `json:"filters,omitempty"`
}

type Destination added in v0.5.1

type Destination struct {
	ID          string                 `json:"id"`
	TeamID      string                 `json:"team_id"`
	Name        string                 `json:"name"`
	Description *string                `json:"description"`
	Type        string                 `json:"type"`
	Config      map[string]interface{} `json:"config"`
	DisabledAt  *time.Time             `json:"disabled_at"`
	UpdatedAt   time.Time              `json:"updated_at"`
	CreatedAt   time.Time              `json:"created_at"`
}

Destination represents a Hookdeck destination

func (*Destination) GetCLIPath added in v1.2.0

func (d *Destination) GetCLIPath() *string

GetCLIPath returns the CLI path from config for CLI-type destinations For CLI destinations, the path is stored in config.path according to the OpenAPI spec

func (*Destination) GetHTTPURL added in v1.2.0

func (d *Destination) GetHTTPURL() *string

GetHTTPURL returns the HTTP URL from config for HTTP-type destinations For HTTP destinations, the URL is stored in config.url according to the OpenAPI spec

func (*Destination) SetCLIPath added in v1.2.0

func (d *Destination) SetCLIPath(path string)

SetCLIPath sets the CLI path in config for CLI-type destinations

type DestinationCreateInput added in v1.2.0

type DestinationCreateInput struct {
	Name        string                 `json:"name"`
	Type        string                 `json:"type"`
	Description *string                `json:"description,omitempty"`
	Config      map[string]interface{} `json:"config,omitempty"`
}

DestinationCreateInput represents input for creating a destination inline

type DestinationCreateRequest added in v1.2.0

type DestinationCreateRequest struct {
	Name        string                 `json:"name"`
	Description *string                `json:"description,omitempty"`
	URL         *string                `json:"url,omitempty"`
	Config      map[string]interface{} `json:"config,omitempty"`
}

DestinationCreateRequest represents the request to create a destination

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 PaginationResponse added in v1.2.0

type PaginationResponse struct {
	OrderBy string  `json:"order_by"`
	Dir     string  `json:"dir"`
	Limit   int     `json:"limit"`
	Next    *string `json:"next"`
	Prev    *string `json:"prev"`
}

PaginationResponse represents pagination metadata

type Project

type Project struct {
	Id   string
	Name string
	Mode string
}

type Rule added in v1.2.0

type Rule map[string]interface{}

Rule represents a connection rule (union type)

type SDKClientInit

type SDKClientInit struct {
	APIBaseURL string
	APIKey     string
	TeamID     string
}

type Session

type Session struct {
	Id string
}

type SessionFilters added in v1.1.0

type SessionFilters struct {
	Body    *json.RawMessage `json:"body,omitempty"`
	Headers *json.RawMessage `json:"headers,omitempty"`
	Query   *json.RawMessage `json:"query,omitempty"`
	Path    *json.RawMessage `json:"path,omitempty"`
}

type Source added in v0.5.1

type Source struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description *string                `json:"description"`
	URL         string                 `json:"url"`
	Type        string                 `json:"type"`
	Config      map[string]interface{} `json:"config"`
	DisabledAt  *time.Time             `json:"disabled_at"`
	UpdatedAt   time.Time              `json:"updated_at"`
	CreatedAt   time.Time              `json:"created_at"`
}

Source represents a Hookdeck source

type SourceCreateInput added in v1.2.0

type SourceCreateInput struct {
	Name        string                 `json:"name"`
	Type        string                 `json:"type"`
	Description *string                `json:"description,omitempty"`
	Config      map[string]interface{} `json:"config,omitempty"`
}

SourceCreateInput represents input for creating a source inline

type SourceCreateRequest added in v1.2.0

type SourceCreateRequest struct {
	Name        string                 `json:"name"`
	Description *string                `json:"description,omitempty"`
	Type        string                 `json:"type,omitempty"`
	Config      map[string]interface{} `json:"config,omitempty"`
}

SourceCreateRequest represents the request to create a source

Jump to

Keyboard shortcuts

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