Documentation ¶
Index ¶
- type AuthCheckResponse
- type Client
- func (c *Client) AuthCheck(ctx context.Context) (*AuthCheckResponse, error)
- func (c *Client) CreateAWSIntegration(ctx context.Context, projectID uint, createAWS *CreateAWSIntegrationRequest) (*CreateAWSIntegrationResponse, error)
- func (c *Client) CreateECR(ctx context.Context, projectID uint, createECR *CreateECRRequest) (*CreateECRResponse, error)
- func (c *Client) CreateGCPIntegration(ctx context.Context, projectID uint, createGCP *CreateGCPIntegrationRequest) (*CreateGCPIntegrationResponse, error)
- func (c *Client) CreateGCR(ctx context.Context, projectID uint, createGCR *CreateGCRRequest) (*CreateGCRResponse, error)
- func (c *Client) CreateProject(ctx context.Context, createProjectRequest *CreateProjectRequest) (*CreateProjectResponse, error)
- func (c *Client) CreateProjectCandidates(ctx context.Context, projectID uint, ...) (CreateProjectCandidatesResponse, error)
- func (c *Client) CreateProjectCluster(ctx context.Context, projectID uint, candidateID uint, ...) (*CreateProjectClusterResponse, error)
- func (c *Client) CreateUser(ctx context.Context, createUserRequest *CreateUserRequest) (*CreateUserResponse, error)
- func (c *Client) DeleteProject(ctx context.Context, projectID uint) (*DeleteProjectResponse, error)
- func (c *Client) DeleteUser(ctx context.Context, userID uint, deleteUserRequest *DeleteUserRequest) error
- func (c *Client) GetK8sNamespaces(ctx context.Context, projectID uint, clusterID uint) (*GetK8sNamespacesResponse, error)
- func (c *Client) GetProject(ctx context.Context, projectID uint) (*GetProjectResponse, error)
- func (c *Client) GetProjectCandidates(ctx context.Context, projectID uint) (GetProjectCandidatesResponse, error)
- func (c *Client) GetProjectCluster(ctx context.Context, projectID uint, clusterID uint) (*GetProjectClusterResponse, error)
- func (c *Client) GetUser(ctx context.Context, userID uint) (*GetUserResponse, error)
- func (c *Client) ListImages(ctx context.Context, projectID uint, registryID uint, repoName string) (ListImagesResponse, error)
- func (c *Client) ListProjectClusters(ctx context.Context, projectID uint) (ListProjectClustersResponse, error)
- func (c *Client) ListRegistryRepositories(ctx context.Context, projectID uint, registryID uint) (ListRegistryRepositoryResponse, error)
- func (c *Client) ListUserProjects(ctx context.Context, userID uint) (ListUserProjectsResponse, error)
- func (c *Client) Login(ctx context.Context, loginRequest *LoginRequest) (*LoginResponse, error)
- func (c *Client) Logout(ctx context.Context) error
- type CookieStorage
- type CreateAWSIntegrationRequest
- type CreateAWSIntegrationResponse
- type CreateECRRequest
- type CreateECRResponse
- type CreateGCPIntegrationRequest
- type CreateGCPIntegrationResponse
- type CreateGCRRequest
- type CreateGCRResponse
- type CreateProjectCandidatesRequest
- type CreateProjectCandidatesResponse
- type CreateProjectClusterResponse
- type CreateProjectRequest
- type CreateProjectResponse
- type CreateUserRequest
- type CreateUserResponse
- type DeleteProjectResponse
- type DeleteUserRequest
- type GetK8sNamespacesResponse
- type GetProjectCandidatesResponse
- type GetProjectClusterResponse
- type GetProjectResponse
- type GetUserResponse
- type HTTPError
- type ListImagesResponse
- type ListProjectClustersResponse
- type ListRegistryRepositoryResponse
- type ListUserProjectsResponse
- type LoginRequest
- type LoginResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthCheckResponse ¶
type AuthCheckResponse models.UserExternal
AuthCheckResponse is the user model response that is returned if the user is logged in
type Client ¶
type Client struct { BaseURL string HTTPClient *http.Client Cookie *http.Cookie CookieFilePath string }
Client represents the client for the Porter API
func (*Client) AuthCheck ¶
func (c *Client) AuthCheck(ctx context.Context) (*AuthCheckResponse, error)
AuthCheck performs a check to ensure that the user is logged in
func (*Client) CreateAWSIntegration ¶
func (c *Client) CreateAWSIntegration( ctx context.Context, projectID uint, createAWS *CreateAWSIntegrationRequest, ) (*CreateAWSIntegrationResponse, error)
CreateAWSIntegration creates an AWS integration with the given request options
func (*Client) CreateECR ¶
func (c *Client) CreateECR( ctx context.Context, projectID uint, createECR *CreateECRRequest, ) (*CreateECRResponse, error)
CreateECR creates an Elastic Container Registry integration
func (*Client) CreateGCPIntegration ¶
func (c *Client) CreateGCPIntegration( ctx context.Context, projectID uint, createGCP *CreateGCPIntegrationRequest, ) (*CreateGCPIntegrationResponse, error)
CreateGCPIntegration creates a GCP integration with the given request options
func (*Client) CreateGCR ¶
func (c *Client) CreateGCR( ctx context.Context, projectID uint, createGCR *CreateGCRRequest, ) (*CreateGCRResponse, error)
CreateGCR creates an Google Container Registry integration
func (*Client) CreateProject ¶
func (c *Client) CreateProject( ctx context.Context, createProjectRequest *CreateProjectRequest, ) (*CreateProjectResponse, error)
CreateProject creates a project with the given request options
func (*Client) CreateProjectCandidates ¶
func (c *Client) CreateProjectCandidates( ctx context.Context, projectID uint, createCandidatesRequest *CreateProjectCandidatesRequest, ) (CreateProjectCandidatesResponse, 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 uint, candidateID uint, createReq *models.ClusterResolverAll, ) (*CreateProjectClusterResponse, error)
CreateProjectCluster creates a cluster given a project id and a candidate id, which gets resolved using the list of actions
func (*Client) CreateUser ¶
func (c *Client) CreateUser( ctx context.Context, createUserRequest *CreateUserRequest, ) (*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) DeleteUser ¶
func (c *Client) DeleteUser( ctx context.Context, userID uint, deleteUserRequest *DeleteUserRequest, ) error
DeleteUser deletes a user of a given user id
func (*Client) GetK8sNamespaces ¶
func (c *Client) GetK8sNamespaces( ctx context.Context, projectID uint, clusterID uint, ) (*GetK8sNamespacesResponse, error)
GetK8sNamespaces gets a namespaces list in a k8s cluster
func (*Client) GetProject ¶
GetProject retrieves a project by id
func (*Client) GetProjectCandidates ¶
func (c *Client) GetProjectCandidates( ctx context.Context, projectID uint, ) (GetProjectCandidatesResponse, error)
GetProjectCandidates returns the service account candidates for a given project id
func (*Client) GetProjectCluster ¶
func (c *Client) GetProjectCluster( ctx context.Context, projectID uint, clusterID uint, ) (*GetProjectClusterResponse, error)
GetProjectCluster retrieves a project's cluster by id
func (*Client) ListImages ¶
func (c *Client) ListImages( ctx context.Context, projectID uint, registryID uint, repoName string, ) (ListImagesResponse, error)
ListImages lists the images (repository+tag) in a repository
func (*Client) ListProjectClusters ¶
func (c *Client) ListProjectClusters( ctx context.Context, projectID uint, ) (ListProjectClustersResponse, error)
ListProjectClusters creates a list of clusters for a given project
func (*Client) ListRegistryRepositories ¶
func (c *Client) ListRegistryRepositories( ctx context.Context, projectID uint, registryID uint, ) (ListRegistryRepositoryResponse, error)
ListRegistryRepositories lists the repositories in a registry
func (*Client) ListUserProjects ¶
func (c *Client) ListUserProjects(ctx context.Context, userID uint) (ListUserProjectsResponse, error)
ListUserProjects returns a list of projects associated with a user
func (*Client) Login ¶
func (c *Client) Login(ctx context.Context, loginRequest *LoginRequest) (*LoginResponse, error)
Login authorizes the user and grants them a cookie-based session
type CookieStorage ¶
CookieStorage for temporary fs-based cookie storage before jwt tokens
type CreateAWSIntegrationRequest ¶
type CreateAWSIntegrationRequest struct { AWSRegion string `json:"aws_region"` AWSAccessKeyID string `json:"aws_access_key_id"` AWSSecretAccessKey string `json:"aws_secret_access_key"` }
CreateAWSIntegrationRequest represents the accepted fields for creating an aws integration
type CreateAWSIntegrationResponse ¶
type CreateAWSIntegrationResponse ints.AWSIntegrationExternal
CreateAWSIntegrationResponse is the resulting integration after creation
type CreateECRRequest ¶
type CreateECRRequest struct { Name string `json:"name"` AWSIntegrationID uint `json:"aws_integration_id"` }
CreateECRRequest represents the accepted fields for creating an ECR registry
type CreateECRResponse ¶
type CreateECRResponse models.RegistryExternal
CreateECRResponse is the resulting registry after creation
type CreateGCPIntegrationRequest ¶
type CreateGCPIntegrationRequest struct {
GCPKeyData string `json:"gcp_key_data"`
}
CreateGCPIntegrationRequest represents the accepted fields for creating a gcp integration
type CreateGCPIntegrationResponse ¶
type CreateGCPIntegrationResponse ints.GCPIntegrationExternal
CreateGCPIntegrationResponse is the resulting integration after creation
type CreateGCRRequest ¶
type CreateGCRRequest struct { Name string `json:"name"` GCPIntegrationID uint `json:"gcp_integration_id"` }
CreateGCRRequest represents the accepted fields for creating a GCR registry
type CreateGCRResponse ¶
type CreateGCRResponse models.RegistryExternal
CreateGCRResponse is the resulting registry after creation
type CreateProjectCandidatesRequest ¶
type CreateProjectCandidatesRequest struct { Kubeconfig string `json:"kubeconfig"` IsLocal bool `json:"is_local"` }
CreateProjectCandidatesRequest creates a project service account candidate, which can be resolved to create a service account
type CreateProjectCandidatesResponse ¶
type CreateProjectCandidatesResponse []*models.ClusterCandidateExternal
CreateProjectCandidatesResponse is the list of candidates returned after creating the candidates
type CreateProjectClusterResponse ¶
type CreateProjectClusterResponse models.ClusterExternal
CreateProjectClusterResponse is the cluster that gets returned after the candidate has been resolved
type CreateProjectRequest ¶
type CreateProjectRequest struct {
Name string `json:"name" form:"required"`
}
CreateProjectRequest represents the accepted fields for creating a project
type CreateProjectResponse ¶
type CreateProjectResponse models.ProjectExternal
CreateProjectResponse is the resulting project after creation
type CreateUserRequest ¶
CreateUserRequest is the email/password associated with creating a user
type CreateUserResponse ¶
type CreateUserResponse models.UserExternal
CreateUserResponse is the user model response that is returned after successfully creating a user
type DeleteProjectResponse ¶
type DeleteProjectResponse models.ProjectExternal
DeleteProjectResponse is the object returned after project deletion
type DeleteUserRequest ¶
type DeleteUserRequest struct {
Password string `json:"password"`
}
DeleteUserRequest is the password needed to verify a user should be deleted
type GetK8sNamespacesResponse ¶
type GetK8sNamespacesResponse v1.NamespaceList
GetK8sNamespacesResponse is the list of namespaces returned when a user has successfully authenticated
type GetProjectCandidatesResponse ¶
type GetProjectCandidatesResponse []*models.ClusterCandidateExternal
GetProjectCandidatesResponse is the list of service account candidates
type GetProjectClusterResponse ¶
type GetProjectClusterResponse models.ClusterExternal
GetProjectClusterResponse is the response returned after querying for a given project's cluster
type GetProjectResponse ¶
type GetProjectResponse models.ProjectExternal
GetProjectResponse is the response returned after querying for a given project
type GetUserResponse ¶
type GetUserResponse models.UserExternal
GetUserResponse is the user model response that is returned after successfully getting a user
type ListImagesResponse ¶
ListImagesResponse is the list of images in a repository
type ListProjectClustersResponse ¶
type ListProjectClustersResponse []models.ClusterExternal
ListProjectClustersResponse lists the linked clusters for a project
type ListRegistryRepositoryResponse ¶
type ListRegistryRepositoryResponse []registry.Repository
ListRegistryRepositoryResponse is the list of repositories in a registry
type ListUserProjectsResponse ¶
type ListUserProjectsResponse []*models.ProjectExternal
ListUserProjectsResponse is the list of projects returned
type LoginRequest ¶
LoginRequest is the email/password associated with a login request
type LoginResponse ¶
type LoginResponse models.UserExternal
LoginResponse is the user model response that is returned after successfully logging in