Documentation
¶
Index ¶
- type AuthCheckResponse
- type Client
- func (c *Client) AuthCheck(ctx context.Context) (*AuthCheckResponse, 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) CreateProjectServiceAccount(ctx context.Context, projectID uint, candidateID uint, ...) (*CreateProjectServiceAccountResponse, 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, serviceAccountID 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) GetProjectServiceAccount(ctx context.Context, projectID uint, saID uint) (*GetProjectServiceAccountResponse, error)
- func (c *Client) GetUser(ctx context.Context, userID uint) (*GetUserResponse, error)
- func (c *Client) ListProjectClusters(ctx context.Context, projectID uint) (ListProjectClustersResponse, 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 CreateProjectCandidatesRequest
- type CreateProjectCandidatesResponse
- type CreateProjectRequest
- type CreateProjectResponse
- type CreateProjectServiceAccountRequest
- type CreateProjectServiceAccountResponse
- type CreateUserRequest
- type CreateUserResponse
- type DeleteProjectResponse
- type DeleteUserRequest
- type GetK8sNamespacesResponse
- type GetProjectCandidatesResponse
- type GetProjectResponse
- type GetProjectServiceAccountResponse
- type GetUserResponse
- type HTTPError
- type ListProjectClustersResponse
- 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) 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) CreateProjectServiceAccount ¶
func (c *Client) CreateProjectServiceAccount( ctx context.Context, projectID uint, candidateID uint, createSARequest CreateProjectServiceAccountRequest, ) (*CreateProjectServiceAccountResponse, error)
CreateProjectServiceAccount creates a service account 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, serviceAccountID 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) GetProjectServiceAccount ¶
func (c *Client) GetProjectServiceAccount( ctx context.Context, projectID uint, saID uint, ) (*GetProjectServiceAccountResponse, error)
GetProjectServiceAccount retrieves a project's service account by id
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) 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 CreateProjectCandidatesRequest ¶
type CreateProjectCandidatesRequest struct {
Kubeconfig string `json:"kubeconfig"`
}
CreateProjectCandidatesRequest creates a project service account candidate, which can be resolved to create a service account
type CreateProjectCandidatesResponse ¶
type CreateProjectCandidatesResponse []*models.ServiceAccountCandidateExternal
CreateProjectCandidatesResponse is the list of candidates returned after creating the candidates
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 CreateProjectServiceAccountRequest ¶
type CreateProjectServiceAccountRequest []*models.ServiceAccountAllActions
CreateProjectServiceAccountRequest is a list of service account actions, which resolve a given service account
type CreateProjectServiceAccountResponse ¶
type CreateProjectServiceAccountResponse models.ServiceAccountExternal
CreateProjectServiceAccountResponse is the service account that gets returned after the actions have been resolved
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.ServiceAccountCandidateExternal
GetProjectCandidatesResponse is the list of service account candidates
type GetProjectResponse ¶
type GetProjectResponse models.ProjectExternal
GetProjectResponse is the response returned after querying for a given project
type GetProjectServiceAccountResponse ¶
type GetProjectServiceAccountResponse models.ServiceAccountExternal
GetProjectServiceAccountResponse is the response returned after querying for a given project's service account
type GetUserResponse ¶
type GetUserResponse models.UserExternal
GetUserResponse is the user model response that is returned after successfully getting a user
type ListProjectClustersResponse ¶
type ListProjectClustersResponse []models.ClusterExternal
ListProjectClustersResponse lists the linked clusters for a project
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