Documentation
¶
Overview ¶
Package project resolves and persists the currently selected Volcano project.
Index ¶
- func Find(ctx context.Context, client *api.Client, identifier string) (*apiclient.Project, error)
- type Service
- func (s Service) Create(ctx context.Context, name, templateID string) (*apiclient.Project, error)
- func (s Service) CreateAnonKey(ctx context.Context, projectID, name string) (*apiclient.AnonKey, error)
- func (s Service) CreateServiceKey(ctx context.Context, projectID, name string, permissions []string) (*apiclient.ServiceKey, error)
- func (s Service) CurrentTarget(ctx context.Context) (Target, error)
- func (s Service) Delete(ctx context.Context, projectID string) error
- func (s Service) DeploymentsSince(ctx context.Context, since time.Time) ([]apiclient.ProjectDeployment, error)
- func (s Service) Get(ctx context.Context, projectID string) (*apiclient.Project, error)
- func (s Service) GetServiceKey(ctx context.Context, projectID, keyID string) (*apiclient.ServiceKey, error)
- func (s Service) List(ctx context.Context, page, limit int) (*config.Config, *apiclient.PaginatedProjects, error)
- func (s Service) ListAnonKeys(ctx context.Context, projectID string) ([]apiclient.AnonKey, error)
- func (s Service) ListServiceKeys(ctx context.Context, projectID string, page, limit int) (*apiclient.PaginatedServiceKeys, error)
- func (s Service) Rename(ctx context.Context, projectID, name string) (*apiclient.Project, error)
- func (s Service) RequireAccountToken() error
- func (s Service) SourceMode(ctx context.Context) (apiclient.ProjectSourceExportStateMode, error)
- func (s Service) Usage(ctx context.Context, projectID string) (*apiclient.ProjectUsageResponse, error)
- func (s Service) Use(ctx context.Context, identifier string) (*apiclient.Project, error)
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service performs authenticated Volcano project workflows.
func NewService ¶
func NewService(deps cliruntime.Deps) Service
NewService returns a project service.
func (Service) CreateAnonKey ¶ added in v0.34.0
func (s Service) CreateAnonKey(ctx context.Context, projectID, name string) (*apiclient.AnonKey, error)
CreateAnonKey creates a publishable key for the selected project.
func (Service) CreateServiceKey ¶ added in v0.34.0
func (s Service) CreateServiceKey(ctx context.Context, projectID, name string, permissions []string) (*apiclient.ServiceKey, error)
CreateServiceKey creates a service key in the selected project. An empty permissions slice is passed through as omitted so the server's full-access default remains authoritative.
func (Service) CurrentTarget ¶ added in v0.46.0
CurrentTarget resolves the current project, and its name when the API or the saved selection has one. A missing name is not an error.
func (Service) DeploymentsSince ¶ added in v0.46.0
func (s Service) DeploymentsSince(ctx context.Context, since time.Time) ([]apiclient.ProjectDeployment, error)
DeploymentsSince lists the current project's function and frontend deployments created at or after since.
func (Service) GetServiceKey ¶ added in v0.34.0
func (s Service) GetServiceKey(ctx context.Context, projectID, keyID string) (*apiclient.ServiceKey, error)
GetServiceKey returns one service key by ID for the selected project.
func (Service) List ¶
func (s Service) List(ctx context.Context, page, limit int) (*config.Config, *apiclient.PaginatedProjects, error)
List returns the authenticated config and one visible project page.
func (Service) ListAnonKeys ¶ added in v0.5.0
ListAnonKeys returns a project's anon keys (the publishable frontend/SDK keys). projectID may be empty to use the currently selected project.
func (Service) ListServiceKeys ¶ added in v0.34.0
func (s Service) ListServiceKeys(ctx context.Context, projectID string, page, limit int) (*apiclient.PaginatedServiceKeys, error)
ListServiceKeys returns one page of service keys for the selected project, or for projectID when it is explicitly provided.
func (Service) Rename ¶ added in v0.25.0
Rename changes a project's name and refreshes the saved active project.
func (Service) RequireAccountToken ¶ added in v0.31.0
RequireAccountToken reports whether the configured credential can run the account-scoped project commands. Renaming and deleting a project are pk-only server-side, and a destructive command has to refuse before it asks the user to confirm something the CLI already knows cannot happen.
func (Service) SourceMode ¶ added in v0.46.0
SourceMode reports whether the current project deploys from Volcano (platform) or from its connected repository. A server without source export has no repository mode, so it reports platform.