Documentation ¶
Index ¶
- func GetProjectIDFromToken(token string) (uint, bool, error)
- type Client
- func (c *Client) AuthCheck(ctx context.Context) (*types.GetAuthenticatedUserResponse, error)
- func (c *Client) CreateAWSIntegration(ctx context.Context, projectID uint, req *types.CreateAWSRequest) (*types.CreateAWSResponse, error)
- func (c *Client) CreateBasicAuthIntegration(ctx context.Context, projectID uint, req *types.CreateBasicRequest) (*types.CreateBasicResponse, error)
- func (c *Client) CreateDNSRecord(ctx context.Context, projID, clusterID uint, namespace, name string) (*types.DNSRecord, error)
- func (c *Client) CreateEvent(ctx context.Context, projID, clusterID uint, namespace, name string, ...) error
- func (c *Client) CreateGCPIntegration(ctx context.Context, projectID uint, req *types.CreateGCPRequest) (*types.CreateGCPResponse, error)
- func (c *Client) CreateProject(ctx context.Context, req *types.CreateProjectRequest) (*types.CreateProjectResponse, error)
- func (c *Client) CreateProjectCandidates(ctx context.Context, projectID uint, req *types.CreateClusterCandidateRequest) (*types.CreateClusterCandidateResponse, error)
- func (c *Client) CreateProjectCluster(ctx context.Context, projectID, candidateID uint, ...) (*types.Cluster, error)
- func (c *Client) CreateRegistry(ctx context.Context, projectID uint, req *types.CreateRegistryRequest) (*types.Registry, error)
- func (c *Client) CreateRepository(ctx context.Context, projectID, regID uint, ...) error
- func (c *Client) CreateUser(ctx context.Context, req *types.CreateUserRequest) (*types.CreateUserResponse, error)
- func (c *Client) DeleteProject(ctx context.Context, projectID uint) error
- func (c *Client) DeleteProjectCluster(ctx context.Context, projectID uint, clusterID uint) error
- func (c *Client) DeleteProjectRegistry(ctx context.Context, projectID uint, registryID uint) error
- func (c *Client) DeleteUser(ctx context.Context) error
- func (c *Client) DeployTemplate(ctx context.Context, projID, clusterID uint, namespace string, ...) error
- func (c *Client) DeployWithWebhook(ctx context.Context, webhook string, req *types.WebhookRequest) error
- func (c *Client) GetDOCRAuthorizationToken(ctx context.Context, projectID uint, req *types.GetRegistryGCRTokenRequest) (*types.GetRegistryTokenResponse, error)
- func (c *Client) GetDockerhubAuthorizationToken(ctx context.Context, projectID uint) (*types.GetRegistryTokenResponse, error)
- func (c *Client) GetECRAuthorizationToken(ctx context.Context, projectID uint, req *types.GetRegistryECRTokenRequest) (*types.GetRegistryTokenResponse, error)
- func (c *Client) GetGCRAuthorizationToken(ctx context.Context, projectID uint, req *types.GetRegistryGCRTokenRequest) (*types.GetRegistryTokenResponse, error)
- func (c *Client) GetK8sAllPods(ctx context.Context, projectID, clusterID uint, namespace, name string) (*types.GetReleaseAllPodsResponse, error)
- func (c *Client) GetK8sNamespaces(ctx context.Context, projectID uint, clusterID uint) (*types.ListNamespacesResponse, error)
- func (c *Client) GetKubeconfig(ctx context.Context, projectID uint, clusterID uint) (*types.GetTemporaryKubeconfigResponse, error)
- func (c *Client) GetProject(ctx context.Context, projectID uint) (*types.ReadProjectResponse, error)
- func (c *Client) GetProjectCandidates(ctx context.Context, projectID uint) (*types.ListClusterCandidateResponse, error)
- func (c *Client) GetProjectCluster(ctx context.Context, projectID uint, clusterID uint) (*types.ClusterGetResponse, error)
- func (c *Client) GetRelease(ctx context.Context, projectID, clusterID uint, namespace, name string) (*types.GetReleaseResponse, error)
- func (c *Client) GetReleaseWebhook(ctx context.Context, projID, clusterID uint, name, namespace string) (*types.PorterRelease, error)
- func (c *Client) GetRepoZIPDownloadURL(ctx context.Context, projID uint, gitInstallationID int64, ...) (*types.GetTarballURLResponse, error)
- func (c *Client) GetTemplate(ctx context.Context, name, version string, req *types.GetTemplateRequest) (*types.GetTemplateResponse, error)
- func (c *Client) ListGitInstallationIDs(ctx context.Context, projID uint) (*types.ListGitInstallationIDsResponse, error)
- func (c *Client) ListGitRepos(ctx context.Context, projID uint, gitInstallationID int64) (*types.ListReposResponse, error)
- func (c *Client) ListImages(ctx context.Context, projectID uint, registryID uint, repoName string) (*types.ListImageResponse, error)
- func (c *Client) ListOAuthIntegrations(ctx context.Context, projectID uint) (*types.ListOAuthResponse, error)
- func (c *Client) ListProjectClusters(ctx context.Context, projectID uint) (*types.ListClusterResponse, error)
- func (c *Client) ListRegistries(ctx context.Context, projectID uint) (*types.RegistryListResponse, error)
- func (c *Client) ListRegistryRepositories(ctx context.Context, projectID uint, registryID uint) (*types.ListRegistryRepositoryResponse, error)
- func (c *Client) ListTemplates(ctx context.Context, req *types.ListTemplatesRequest) (*types.ListTemplatesResponse, error)
- func (c *Client) ListUserProjects(ctx context.Context) (*types.ListUserProjectsResponse, error)
- func (c *Client) Login(ctx context.Context, req *types.LoginUserRequest) (*types.GetAuthenticatedUserResponse, error)
- func (c *Client) Logout(ctx context.Context) error
- func (c *Client) UpdateBatchImage(ctx context.Context, projID, clusterID uint, namespace string, ...) error
- func (c *Client) UpgradeRelease(ctx context.Context, projID, clusterID uint, namespace, name string, ...) error
- type CookieStorage
- type TokenProjectID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { BaseURL string HTTPClient *http.Client Cookie *http.Cookie CookieFilePath string Token string }
Client represents the client for the Porter API
func NewClientWithToken ¶
func (*Client) CreateAWSIntegration ¶
func (c *Client) CreateAWSIntegration( ctx context.Context, projectID uint, req *types.CreateAWSRequest, ) (*types.CreateAWSResponse, error)
CreateAWSIntegration creates an AWS integration with the given request options
func (*Client) CreateBasicAuthIntegration ¶
func (c *Client) CreateBasicAuthIntegration( ctx context.Context, projectID uint, req *types.CreateBasicRequest, ) (*types.CreateBasicResponse, error)
CreateBasicAuthIntegration creates a "basic auth" integration
func (*Client) CreateDNSRecord ¶
func (c *Client) CreateDNSRecord( ctx context.Context, projID, clusterID uint, namespace, name string, ) (*types.DNSRecord, error)
CreateDNSRecord creates a Github action with basic authentication
func (*Client) CreateEvent ¶
func (c *Client) CreateEvent( ctx context.Context, projID, clusterID uint, namespace, name string, req *types.UpdateReleaseStepsRequest, ) error
CreateEvent sends an event from deployment to the api
func (*Client) CreateGCPIntegration ¶
func (c *Client) CreateGCPIntegration( ctx context.Context, projectID uint, req *types.CreateGCPRequest, ) (*types.CreateGCPResponse, error)
CreateGCPIntegration creates a GCP integration with the given request options
func (*Client) CreateProject ¶
func (c *Client) CreateProject( ctx context.Context, req *types.CreateProjectRequest, ) (*types.CreateProjectResponse, error)
CreateProject creates a project with the given request options
func (*Client) CreateProjectCandidates ¶
func (c *Client) CreateProjectCandidates( ctx context.Context, projectID uint, req *types.CreateClusterCandidateRequest, ) (*types.CreateClusterCandidateResponse, error)
CreateProjectCandidates creates a service account candidate for a given project, accepting a kubeconfig that gets parsed into a candidate
func (*Client) CreateProjectCluster ¶
func (c *Client) CreateProjectCluster( ctx context.Context, projectID, candidateID uint, req *types.ClusterResolverAll, ) (*types.Cluster, error)
CreateProjectCluster creates a cluster given a project id and a candidate id, which gets resolved using the list of actions
func (*Client) CreateRegistry ¶
func (c *Client) CreateRegistry( ctx context.Context, projectID uint, req *types.CreateRegistryRequest, ) (*types.Registry, error)
CreateRegistry creates a new registry integration
func (*Client) CreateRepository ¶
func (*Client) CreateUser ¶
func (c *Client) CreateUser( ctx context.Context, req *types.CreateUserRequest, ) (*types.CreateUserResponse, error)
CreateUser will create the user, authorize the user and grant them a cookie-based session
func (*Client) DeleteProject ¶
// DeleteProject deletes a project by id
func (*Client) DeleteProjectCluster ¶
DeleteProjectCluster deletes a cluster given a project id and cluster id
func (*Client) DeleteProjectRegistry ¶
func (c *Client) DeleteProjectRegistry( ctx context.Context, projectID uint, registryID uint, ) error
DeleteProjectRegistry deletes a registry given a project id and registry id
func (*Client) DeleteUser ¶
DeleteUser deletes the current user
func (*Client) DeployTemplate ¶
func (*Client) DeployWithWebhook ¶
func (c *Client) DeployWithWebhook( ctx context.Context, webhook string, req *types.WebhookRequest, ) error
DeployWithWebhook deploys an application with an image tag using a unique webhook URI
func (*Client) GetDOCRAuthorizationToken ¶
func (c *Client) GetDOCRAuthorizationToken( ctx context.Context, projectID uint, req *types.GetRegistryGCRTokenRequest, ) (*types.GetRegistryTokenResponse, error)
GetDOCRAuthorizationToken gets a DOCR authorization token
func (*Client) GetDockerhubAuthorizationToken ¶
func (c *Client) GetDockerhubAuthorizationToken( ctx context.Context, projectID uint, ) (*types.GetRegistryTokenResponse, error)
GetDockerhubAuthorizationToken gets a Docker Hub authorization token
func (*Client) GetECRAuthorizationToken ¶
func (c *Client) GetECRAuthorizationToken( ctx context.Context, projectID uint, req *types.GetRegistryECRTokenRequest, ) (*types.GetRegistryTokenResponse, error)
GetECRAuthorizationToken gets an ECR authorization token
func (*Client) GetGCRAuthorizationToken ¶
func (c *Client) GetGCRAuthorizationToken( ctx context.Context, projectID uint, req *types.GetRegistryGCRTokenRequest, ) (*types.GetRegistryTokenResponse, error)
GetGCRAuthorizationToken gets a GCR authorization token
func (*Client) GetK8sAllPods ¶
func (c *Client) GetK8sAllPods( ctx context.Context, projectID, clusterID uint, namespace, name string, ) (*types.GetReleaseAllPodsResponse, error)
GetK8sAllPods gets all pods for a given release
func (*Client) GetK8sNamespaces ¶
func (c *Client) GetK8sNamespaces( ctx context.Context, projectID uint, clusterID uint, ) (*types.ListNamespacesResponse, error)
GetK8sNamespaces gets a namespaces list in a k8s cluster
func (*Client) GetKubeconfig ¶
func (*Client) GetProject ¶
func (c *Client) GetProject( ctx context.Context, projectID uint, ) (*types.ReadProjectResponse, error)
GetProject retrieves a project by id
func (*Client) GetProjectCandidates ¶
func (c *Client) GetProjectCandidates( ctx context.Context, projectID uint, ) (*types.ListClusterCandidateResponse, error)
GetProjectCandidates returns the cluster candidates for a given project id
func (*Client) GetProjectCluster ¶
func (c *Client) GetProjectCluster( ctx context.Context, projectID uint, clusterID uint, ) (*types.ClusterGetResponse, error)
GetProjectCluster retrieves a project's cluster by id
func (*Client) GetRelease ¶
func (*Client) GetReleaseWebhook ¶
func (c *Client) GetReleaseWebhook( ctx context.Context, projID, clusterID uint, name, namespace string, ) (*types.PorterRelease, error)
GetReleaseWebhook retrieves the release webhook for a given release
func (*Client) GetRepoZIPDownloadURL ¶
func (*Client) GetTemplate ¶
func (c *Client) GetTemplate( ctx context.Context, name, version string, req *types.GetTemplateRequest, ) (*types.GetTemplateResponse, error)
func (*Client) ListGitInstallationIDs ¶
func (c *Client) ListGitInstallationIDs( ctx context.Context, projID uint, ) (*types.ListGitInstallationIDsResponse, error)
ListGitInstallationIDs returns a list of Git installation IDs for a user
func (*Client) ListGitRepos ¶
func (c *Client) ListGitRepos( ctx context.Context, projID uint, gitInstallationID int64, ) (*types.ListReposResponse, error)
ListGitRepos returns a list of Git installation IDs for a user
func (*Client) ListImages ¶
func (c *Client) ListImages( ctx context.Context, projectID uint, registryID uint, repoName string, ) (*types.ListImageResponse, error)
ListImages lists the images (repository+tag) in a repository
func (*Client) ListOAuthIntegrations ¶
func (c *Client) ListOAuthIntegrations( ctx context.Context, projectID uint, ) (*types.ListOAuthResponse, error)
ListOAuthIntegrations lists the oauth integrations in a project
func (*Client) ListProjectClusters ¶
func (c *Client) ListProjectClusters( ctx context.Context, projectID uint, ) (*types.ListClusterResponse, error)
ListProjectClusters creates a list of clusters for a given project
func (*Client) ListRegistries ¶
func (c *Client) ListRegistries( ctx context.Context, projectID uint, ) (*types.RegistryListResponse, error)
ListRegistries returns a list of registries for a project
func (*Client) ListRegistryRepositories ¶
func (c *Client) ListRegistryRepositories( ctx context.Context, projectID uint, registryID uint, ) (*types.ListRegistryRepositoryResponse, error)
ListRegistryRepositories lists the repositories in a registry
func (*Client) ListTemplates ¶
func (c *Client) ListTemplates( ctx context.Context, req *types.ListTemplatesRequest, ) (*types.ListTemplatesResponse, error)
func (*Client) ListUserProjects ¶
ListUserProjects returns a list of projects associated with a user
func (*Client) Login ¶
func (c *Client) Login(ctx context.Context, req *types.LoginUserRequest) (*types.GetAuthenticatedUserResponse, error)
Login authorizes the user and grants them a cookie-based session
func (*Client) UpdateBatchImage ¶
func (c *Client) UpdateBatchImage( ctx context.Context, projID, clusterID uint, namespace string, req *types.UpdateImageBatchRequest, ) error
UpdateBatchImage updates all releases that use a certain image with a new tag, within a single namespace
func (*Client) UpgradeRelease ¶
func (c *Client) UpgradeRelease( ctx context.Context, projID, clusterID uint, namespace, name string, req *types.UpgradeReleaseRequest, ) error
UpgradeRelease upgrades a specific release with new values or chart version
type CookieStorage ¶
CookieStorage for temporary fs-based cookie storage before jwt tokens
type TokenProjectID ¶
type TokenProjectID struct {
ProjectID uint `json:"project_id"`
}