api

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package api provides a client for the Pantheon API.

Index

Constants

View Source
const (
	// DefaultBaseURL is the base URL for the Pantheon API
	DefaultBaseURL = "https://terminus.pantheon.io:443/api"

	// DefaultTimeout is the default timeout for HTTP requests
	DefaultTimeout = 86400 * time.Second

	// MaxRetries is the maximum number of retry attempts
	MaxRetries = 5

	// InitialBackoff is the initial backoff duration for retries
	InitialBackoff = 1 * time.Second
)

Variables

This section is empty.

Functions

func DecodeResponse

func DecodeResponse(resp *http.Response, target interface{}) error

DecodeResponse decodes a JSON response into a target struct

func EnsureSiteUUID

func EnsureSiteUUID(ctx context.Context, client *Client, siteIdentifier string) (string, error)

EnsureSiteUUID converts a site identifier (name or UUID) to a UUID

func IsConflict

func IsConflict(err error) bool

IsConflict returns true if the error is a 409 Conflict

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the error is a 404 Not Found

func IsUUID

func IsUUID(s string) bool

IsUUID checks if a string looks like a UUID

func ResolveSiteNameToID

func ResolveSiteNameToID(ctx context.Context, client *Client, siteName string) (string, error)

ResolveSiteNameToID converts a site name to a UUID using the API

Types

type AddTeamMemberRequest

type AddTeamMemberRequest struct {
	Email string `json:"email"`
	Role  string `json:"role"`
}

AddTeamMemberRequest represents a request to add a team member

type AuthService

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

AuthService handles authentication operations

func NewAuthService

func NewAuthService(client *Client) *AuthService

NewAuthService creates a new auth service

func (*AuthService) Login

func (s *AuthService) Login(ctx context.Context, machineToken string) (*SessionResponse, error)

Login authenticates using a machine token and returns a session

func (*AuthService) ValidateSession

func (s *AuthService) ValidateSession(ctx context.Context, userID string) (bool, error)

ValidateSession checks if the current session is valid

func (*AuthService) Whoami

func (s *AuthService) Whoami(ctx context.Context, userID string) (*models.User, error)

Whoami returns information about the current user

type BackupsService

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

BackupsService handles backup-related operations

func NewBackupsService

func NewBackupsService(client *Client) *BackupsService

NewBackupsService creates a new backups service

func (*BackupsService) Create

func (s *BackupsService) Create(ctx context.Context, siteID, envID string, req *CreateBackupRequest) (*models.Workflow, error)

Create creates a new backup

func (*BackupsService) CreateElement

func (s *BackupsService) CreateElement(ctx context.Context, siteID, envID, element string) (*models.Workflow, error)

CreateElement creates a backup of a specific element (code, database, files)

func (*BackupsService) Download

func (s *BackupsService) Download(ctx context.Context, siteID, envID, backupID, element, outputPath string) error

Download downloads a backup element to a file

func (*BackupsService) Get

func (s *BackupsService) Get(ctx context.Context, siteID, envID, backupID string) (*models.Backup, error)

Get returns a specific backup

func (*BackupsService) GetDownloadURL

func (s *BackupsService) GetDownloadURL(ctx context.Context, siteID, envID, backupID, element string) (string, error)

GetDownloadURL returns the download URL for a backup element

func (*BackupsService) GetSchedule

func (s *BackupsService) GetSchedule(ctx context.Context, siteID, envID string) (map[string]interface{}, error)

GetSchedule returns the backup schedule for an environment

func (*BackupsService) List

func (s *BackupsService) List(ctx context.Context, siteID, envID string) ([]*models.Backup, error)

List returns all backups for an environment

func (*BackupsService) Restore

func (s *BackupsService) Restore(ctx context.Context, siteID, envID, backupID string) (*models.Workflow, error)

Restore restores a backup

func (*BackupsService) SetSchedule

func (s *BackupsService) SetSchedule(ctx context.Context, siteID, envID string, enabled bool, day int) error

SetSchedule sets the backup schedule for an environment

type Client

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

Client is the HTTP client for the Pantheon API

func NewClient

func NewClient(options ...ClientOption) *Client

NewClient creates a new API client

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, path string) (*http.Response, error)

Delete makes a DELETE request

func (*Client) Get

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

Get makes a GET request

func (*Client) GetPaged

func (c *Client) GetPaged(ctx context.Context, basePath string) ([]json.RawMessage, error)

GetPaged makes paginated GET requests using cursor-based pagination and returns all results The Pantheon API uses cursor-based pagination with 'start' parameter (ID of last item) rather than page-based pagination

func (*Client) Patch

func (c *Client) Patch(ctx context.Context, path string, body interface{}) (*http.Response, error)

Patch makes a PATCH request

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, body interface{}) (*http.Response, error)

Post makes a POST request

func (*Client) Put

func (c *Client) Put(ctx context.Context, path string, body interface{}) (*http.Response, error)

Put makes a PUT request

func (*Client) Request

func (c *Client) Request(ctx context.Context, method, path string, body interface{}) (*http.Response, error)

Request makes an HTTP request to the API with retry logic

func (*Client) SetToken

func (c *Client) SetToken(token string)

SetToken updates the authentication token

type ClientOption

type ClientOption func(*Client)

ClientOption is a function that configures a Client

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL sets a custom base URL

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOption

WithHTTPClient sets a custom HTTP client

func WithLogger

func WithLogger(logger Logger) ClientOption

WithLogger sets a custom logger

func WithToken

func WithToken(token string) ClientOption

WithToken sets the authentication token

type CloneContentRequest

type CloneContentRequest struct {
	FromEnvironment string `json:"from_environment"`
	Database        bool   `json:"db,omitempty"`
	Files           bool   `json:"files,omitempty"`
}

CloneContentRequest represents a clone content request

type CommitRequest

type CommitRequest struct {
	Message string `json:"message"`
}

CommitRequest represents a commit request

type CreateBackupRequest

type CreateBackupRequest struct {
	KeepFor int `json:"ttl,omitempty"` // TTL in days
}

CreateBackupRequest represents a backup creation request

type CreateMultidevRequest

type CreateMultidevRequest struct {
	FromEnvironment               string `json:"from_environment"`
	CloudDevelopmentEnvironmentID string `json:"cloud_development_environment_id"`
}

CreateMultidevRequest represents a multidev creation request

type CreateSiteRequest

type CreateSiteRequest struct {
	SiteName     string `json:"site_name"`
	Label        string `json:"label,omitempty"`
	UpstreamID   string `json:"upstream_id"`
	Organization string `json:"organization_id,omitempty"`
	Region       string `json:"preferred_zone,omitempty"`
}

CreateSiteRequest represents a site creation request

type DefaultLogger

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

DefaultLogger is a default implementation of the Logger interface

func NewLogger

func NewLogger(verbosity VerbosityLevel) *DefaultLogger

NewLogger creates a new logger with the specified verbosity level

func NewLoggerWithWriter

func NewLoggerWithWriter(verbosity VerbosityLevel, w io.Writer) *DefaultLogger

NewLoggerWithWriter creates a new logger with a custom writer

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(msg string, args ...interface{})

Debug logs a debug message

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(msg string, args ...interface{})

Error logs an error message

func (*DefaultLogger) GetVerbosity

func (l *DefaultLogger) GetVerbosity() VerbosityLevel

GetVerbosity returns the current verbosity level

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(msg string, args ...interface{})

Info logs an info message

func (*DefaultLogger) IsTraceEnabled

func (l *DefaultLogger) IsTraceEnabled() bool

IsTraceEnabled returns true if trace logging is enabled

func (*DefaultLogger) LogHTTPRequest

func (l *DefaultLogger) LogHTTPRequest(method, url string, headers map[string][]string, body string)

LogHTTPRequest logs HTTP request details at trace level

func (*DefaultLogger) LogHTTPResponse

func (l *DefaultLogger) LogHTTPResponse(statusCode int, status string, headers map[string][]string, body string)

LogHTTPResponse logs HTTP response details at trace level

func (*DefaultLogger) Trace

func (l *DefaultLogger) Trace(msg string, args ...interface{})

Trace logs a trace message (only at highest verbosity)

func (*DefaultLogger) Warn

func (l *DefaultLogger) Warn(msg string, args ...interface{})

Warn logs a warning message

type DeployRequest

type DeployRequest struct {
	UpdateDB   bool   `json:"updatedb,omitempty"`
	Note       string `json:"annotation,omitempty"`
	ClearCache bool   `json:"clear_cache,omitempty"`
}

DeployRequest represents a deploy request

type DomainsService

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

DomainsService handles domain-related operations

func NewDomainsService

func NewDomainsService(client *Client) *DomainsService

NewDomainsService creates a new domains service

func (*DomainsService) Add

func (s *DomainsService) Add(ctx context.Context, siteID, envID, domain string) (*models.Domain, error)

Add adds a domain to an environment

func (*DomainsService) Get

func (s *DomainsService) Get(ctx context.Context, siteID, envID, domainID string) (*models.Domain, error)

Get returns a specific domain

func (*DomainsService) GetDNS

func (s *DomainsService) GetDNS(ctx context.Context, siteID, envID, domainID string) ([]*models.DNSRecord, error)

GetDNS returns DNS recommendations for a domain

func (*DomainsService) List

func (s *DomainsService) List(ctx context.Context, siteID, envID string) ([]*models.Domain, error)

List returns all domains for an environment

func (*DomainsService) Remove

func (s *DomainsService) Remove(ctx context.Context, siteID, envID, domainID string) error

Remove removes a domain from an environment

type EnvironmentsService

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

EnvironmentsService handles environment-related operations

func NewEnvironmentsService

func NewEnvironmentsService(client *Client) *EnvironmentsService

NewEnvironmentsService creates a new environments service

func (*EnvironmentsService) ApplyUpstreamUpdates

func (s *EnvironmentsService) ApplyUpstreamUpdates(ctx context.Context, siteID, envID string, updateDB, acceptUpstream bool) (*models.Workflow, error)

ApplyUpstreamUpdates applies upstream updates

func (*EnvironmentsService) ChangeConnectionMode

func (s *EnvironmentsService) ChangeConnectionMode(ctx context.Context, siteID, envID, mode string) (*models.Workflow, error)

ChangeConnectionMode changes the connection mode (git or sftp)

func (*EnvironmentsService) ClearCache

func (s *EnvironmentsService) ClearCache(ctx context.Context, siteID, envID string) (*models.Workflow, error)

ClearCache clears the cache for an environment

func (*EnvironmentsService) CloneContent

func (s *EnvironmentsService) CloneContent(ctx context.Context, siteID, envID string, req *CloneContentRequest) (*models.Workflow, error)

CloneContent clones database and/or files from one environment to another

func (*EnvironmentsService) Commit

func (s *EnvironmentsService) Commit(ctx context.Context, siteID, envID string, req *CommitRequest) (*models.Workflow, error)

Commit commits changes in an environment

func (*EnvironmentsService) Deploy

func (s *EnvironmentsService) Deploy(ctx context.Context, siteID, envID string, req *DeployRequest) (*models.Workflow, error)

Deploy deploys code to an environment

func (*EnvironmentsService) Get

func (s *EnvironmentsService) Get(ctx context.Context, siteID, envID string) (*models.Environment, error)

Get returns a specific environment

func (*EnvironmentsService) GetConnectionInfo

func (s *EnvironmentsService) GetConnectionInfo(ctx context.Context, siteID, envID string) (*models.ConnectionInfo, error)

GetConnectionInfo returns connection information for an environment

func (*EnvironmentsService) GetLock

func (s *EnvironmentsService) GetLock(ctx context.Context, siteID, envID string) (*models.Lock, error)

GetLock returns lock information for an environment

func (*EnvironmentsService) GetMetrics added in v0.6.0

func (s *EnvironmentsService) GetMetrics(ctx context.Context, siteIdentifier, envID, duration string) ([]*models.Metrics, error)

GetMetrics returns traffic metrics for an environment

func (*EnvironmentsService) GetUpstreamUpdates

func (s *EnvironmentsService) GetUpstreamUpdates(ctx context.Context, siteID, envID string) (*models.UpstreamUpdate, error)

GetUpstreamUpdates returns upstream update information

func (*EnvironmentsService) List

func (s *EnvironmentsService) List(ctx context.Context, siteIdentifier string) ([]*models.Environment, error)

List returns all environments for a site

func (*EnvironmentsService) RemoveLock

func (s *EnvironmentsService) RemoveLock(ctx context.Context, siteID, envID string) error

RemoveLock removes the lock from an environment

func (*EnvironmentsService) SetLock

func (s *EnvironmentsService) SetLock(ctx context.Context, siteID, envID, username, password string) error

SetLock sets or updates the lock for an environment

func (*EnvironmentsService) Wipe

func (s *EnvironmentsService) Wipe(ctx context.Context, siteID, envID string) (*models.Workflow, error)

Wipe wipes an environment's content

type Error

type Error struct {
	StatusCode int
	Message    string
}

Error represents an API error response

func (*Error) Error

func (e *Error) Error() string

type HTTPLogger

type HTTPLogger interface {
	Logger
	LogHTTPRequest(method, url string, headers map[string][]string, body string)
	LogHTTPResponse(statusCode int, status string, headers map[string][]string, body string)
	IsTraceEnabled() bool
}

HTTPLogger is an interface for logging HTTP requests and responses

func AsHTTPLogger

func AsHTTPLogger(logger Logger) (HTTPLogger, bool)

AsHTTPLogger safely converts a Logger to HTTPLogger if possible

type Logger

type Logger interface {
	Debug(msg string, args ...interface{})
	Info(msg string, args ...interface{})
	Warn(msg string, args ...interface{})
	Error(msg string, args ...interface{})
}

Logger is an interface for logging

type LoginRequest

type LoginRequest struct {
	MachineToken string `json:"machine_token"`
	Client       string `json:"client"`
}

LoginRequest represents a machine token login request

type MultidevService

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

MultidevService handles multidev environment operations

func NewMultidevService

func NewMultidevService(client *Client) *MultidevService

NewMultidevService creates a new multidev service

func (*MultidevService) Create

func (s *MultidevService) Create(ctx context.Context, siteID, envName, fromEnv string) (*models.Workflow, error)

Create creates a new multidev environment

func (*MultidevService) Delete

func (s *MultidevService) Delete(ctx context.Context, siteID, envID string, deleteBranch bool) (*models.Workflow, error)

Delete deletes a multidev environment

func (*MultidevService) List

func (s *MultidevService) List(ctx context.Context, siteID string) ([]*models.Environment, error)

List returns multidev environments for a site (excludes dev, test, live)

func (*MultidevService) MergeFromDev

func (s *MultidevService) MergeFromDev(ctx context.Context, siteID, envID string, updateDB bool) (*models.Workflow, error)

MergeFromDev merges dev into a multidev

func (*MultidevService) MergeToDev

func (s *MultidevService) MergeToDev(ctx context.Context, siteID, envID string, updateDB bool) (*models.Workflow, error)

MergeToDev merges a multidev to dev

type OrganizationsService

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

OrganizationsService handles organization-related operations

func NewOrganizationsService

func NewOrganizationsService(client *Client) *OrganizationsService

NewOrganizationsService creates a new organizations service

func (*OrganizationsService) Get

Get returns a specific organization

func (*OrganizationsService) List

func (s *OrganizationsService) List(ctx context.Context, userID string) ([]*models.Organization, error)

List returns all organizations for the authenticated user

func (*OrganizationsService) ListMembers

func (s *OrganizationsService) ListMembers(ctx context.Context, orgID string) ([]*models.User, error)

ListMembers returns members of an organization

func (*OrganizationsService) ListUpstreams

func (s *OrganizationsService) ListUpstreams(ctx context.Context, orgID string) ([]*models.Upstream, error)

ListUpstreams returns upstreams for an organization

type RedisService

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

RedisService handles Redis-related operations

func NewRedisService

func NewRedisService(client *Client) *RedisService

NewRedisService creates a new Redis service

func (*RedisService) Disable

func (s *RedisService) Disable(ctx context.Context, siteID string) (*models.Workflow, error)

Disable disables Redis for a site

func (*RedisService) Enable

func (s *RedisService) Enable(ctx context.Context, siteID string) (*models.Workflow, error)

Enable enables Redis for a site

type SessionResponse

type SessionResponse struct {
	Session   string `json:"session"`
	UserID    string `json:"user_id"`
	ExpiresAt int64  `json:"expires_at"`
}

SessionResponse represents the session response from login

type SitesService

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

SitesService handles site-related operations

func NewSitesService

func NewSitesService(client *Client) *SitesService

NewSitesService creates a new sites service

func (*SitesService) AddTag

func (s *SitesService) AddTag(ctx context.Context, siteIdentifier, orgID, tagName string) error

AddTag adds a tag to a site

func (*SitesService) AddTeamMember

func (s *SitesService) AddTeamMember(ctx context.Context, siteIdentifier string, req *AddTeamMemberRequest) (*models.TeamMember, error)

AddTeamMember adds a team member to a site

func (*SitesService) Create

func (s *SitesService) Create(ctx context.Context, userID string, req *CreateSiteRequest) (*models.Site, error)

Create creates a new site using workflows

func (*SitesService) Delete

func (s *SitesService) Delete(ctx context.Context, siteIdentifier string) error

Delete deletes a site using the delete_site workflow

func (*SitesService) Get

func (s *SitesService) Get(ctx context.Context, siteIdentifier string) (*models.Site, error)

Get returns a specific site by ID or name

func (*SitesService) GetPlan

func (s *SitesService) GetPlan(ctx context.Context, siteIdentifier string) (*models.Plan, error)

GetPlan returns the plan for a site

func (*SitesService) GetPlans

func (s *SitesService) GetPlans(ctx context.Context, siteIdentifier string) ([]*models.Plan, error)

GetPlans returns available plans for a site

func (*SitesService) GetTags

func (s *SitesService) GetTags(ctx context.Context, siteIdentifier, orgID string) ([]*models.Tag, error)

GetTags returns tags for a site

func (*SitesService) GetTeam

func (s *SitesService) GetTeam(ctx context.Context, siteIdentifier string) ([]*models.TeamMember, error)

GetTeam returns team members for a site

func (*SitesService) List

func (s *SitesService) List(ctx context.Context, userID string) ([]*models.Site, error)

List returns all sites accessible to the authenticated user

func (*SitesService) ListBranches

func (s *SitesService) ListBranches(ctx context.Context, siteIdentifier string) ([]*models.Branch, error)

ListBranches returns git branches for a site

func (*SitesService) ListByOrganization

func (s *SitesService) ListByOrganization(ctx context.Context, orgID string) ([]*models.Site, error)

ListByOrganization returns sites for a specific organization

func (*SitesService) ListOrganizations

func (s *SitesService) ListOrganizations(ctx context.Context, siteIdentifier string) ([]*models.SiteOrganizationMembership, error)

ListOrganizations returns organizations that a site belongs to

func (*SitesService) RemoveTag

func (s *SitesService) RemoveTag(ctx context.Context, siteIdentifier, orgID, tagName string) error

RemoveTag removes a tag from a site

func (*SitesService) RemoveTeamMember

func (s *SitesService) RemoveTeamMember(ctx context.Context, siteIdentifier, userID string) error

RemoveTeamMember removes a team member from a site

func (*SitesService) Update

func (s *SitesService) Update(ctx context.Context, siteIdentifier string, req *UpdateRequest) (*models.Site, error)

Update updates a site

type UpdateRequest

type UpdateRequest struct {
	Label        string `json:"label,omitempty"`
	ServiceLevel string `json:"service_level,omitempty"`
}

UpdateRequest represents a site update request

type UpstreamsService

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

UpstreamsService handles upstream-related operations

func NewUpstreamsService

func NewUpstreamsService(client *Client) *UpstreamsService

NewUpstreamsService creates a new upstreams service

func (*UpstreamsService) Get

func (s *UpstreamsService) Get(ctx context.Context, upstreamID string) (*models.Upstream, error)

Get returns a specific upstream by ID

func (*UpstreamsService) List

func (s *UpstreamsService) List(ctx context.Context, userID string) ([]*models.Upstream, error)

List returns all upstreams accessible to the authenticated user

func (*UpstreamsService) ListUpdates

func (s *UpstreamsService) ListUpdates(ctx context.Context, siteID, envID string) ([]*models.UpstreamUpdateCommit, error)

ListUpdates returns the list of upstream update commits for a site environment

func (*UpstreamsService) ResolveToID

func (s *UpstreamsService) ResolveToID(ctx context.Context, upstreamIdentifier, userID string) (string, error)

ResolveToID converts an upstream identifier (machine name or UUID) to a UUID

type UsersService

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

UsersService handles user-related operations

func NewUsersService

func NewUsersService(client *Client) *UsersService

NewUsersService creates a new users service

func (*UsersService) ListMachineTokens

func (s *UsersService) ListMachineTokens(ctx context.Context, userID string) ([]*models.MachineToken, error)

ListMachineTokens returns machine tokens for the authenticated user

func (*UsersService) ListPaymentMethods

func (s *UsersService) ListPaymentMethods(ctx context.Context, userID string) ([]*models.PaymentMethod, error)

ListPaymentMethods returns payment methods for the authenticated user

func (*UsersService) ListSSHKeys

func (s *UsersService) ListSSHKeys(ctx context.Context, userID string) ([]*models.SSHKey, error)

ListSSHKeys returns SSH keys for the authenticated user

type VerbosityLevel

type VerbosityLevel int

VerbosityLevel represents the logging verbosity level

const (
	// VerbosityNone disables all logging
	VerbosityNone VerbosityLevel = 0
	// VerbosityInfo enables info level logging (-v)
	VerbosityInfo VerbosityLevel = 1
	// VerbosityDebug enables debug level logging (-vv)
	VerbosityDebug VerbosityLevel = 2
	// VerbosityTrace enables trace level logging including HTTP details (-vvv)
	VerbosityTrace VerbosityLevel = 3
)

type WaitOptions

type WaitOptions struct {
	// PollInterval is how often to check workflow status
	PollInterval time.Duration
	// Timeout is the maximum time to wait
	Timeout time.Duration
	// OnProgress is called on each poll with the current workflow state
	OnProgress func(*models.Workflow)
}

WaitOptions configures workflow wait behavior

func DefaultWaitOptions

func DefaultWaitOptions() *WaitOptions

DefaultWaitOptions returns default wait options

type WatchOptions

type WatchOptions struct {
	PollInterval time.Duration
	OnUpdate     func(*models.Workflow)
}

WatchOptions configures workflow watch behavior

type WorkflowsService

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

WorkflowsService handles workflow-related operations

func NewWorkflowsService

func NewWorkflowsService(client *Client) *WorkflowsService

NewWorkflowsService creates a new workflows service

func (*WorkflowsService) CreateForSite

func (s *WorkflowsService) CreateForSite(ctx context.Context, siteID, workflowType string, params map[string]interface{}) (*models.Workflow, error)

CreateForSite creates a workflow for a site

func (*WorkflowsService) CreateForUser

func (s *WorkflowsService) CreateForUser(ctx context.Context, userID, workflowType string, params map[string]interface{}) (*models.Workflow, error)

CreateForUser creates a workflow for a user

func (*WorkflowsService) Get

func (s *WorkflowsService) Get(ctx context.Context, siteID, workflowID string) (*models.Workflow, error)

Get returns a specific workflow

func (*WorkflowsService) GetForUser

func (s *WorkflowsService) GetForUser(ctx context.Context, userID, workflowID string) (*models.Workflow, error)

GetForUser gets a workflow for a user

func (*WorkflowsService) List

func (s *WorkflowsService) List(ctx context.Context, siteID string) ([]*models.Workflow, error)

List returns all workflows for a site

func (*WorkflowsService) ListForEnvironment

func (s *WorkflowsService) ListForEnvironment(ctx context.Context, siteID, envID string) ([]*models.Workflow, error)

ListForEnvironment returns workflows for a specific environment

func (*WorkflowsService) Wait

func (s *WorkflowsService) Wait(ctx context.Context, siteID, workflowID string, opts *WaitOptions) (*models.Workflow, error)

Wait waits for a workflow to complete

func (*WorkflowsService) WaitForUser

func (s *WorkflowsService) WaitForUser(ctx context.Context, userID, workflowID string, opts *WaitOptions) (*models.Workflow, error)

WaitForUser waits for a user workflow to complete

func (*WorkflowsService) Watch

func (s *WorkflowsService) Watch(ctx context.Context, siteID, workflowID string, opts *WatchOptions) error

Watch watches a workflow and calls OnUpdate on each status change

Directories

Path Synopsis
Package models defines data structures for Pantheon API resources.
Package models defines data structures for Pantheon API resources.

Jump to

Keyboard shortcuts

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