{"modulePath":"cdr.dev/coder-cli","version":"v1.39.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package coderutil\n\nPackage coderutil providers utilities for high-level operations on coder-sdk entities.\n\n## Functions\n\n```go\nfunc DefaultWorkspaceProvider(ctx context.Context, c coder.Client) (*coder.KubernetesProvider, error)\n```\nDefaultWorkspaceProvider returns the default provider with which to create workspaces.\n\n```go\nfunc DialWorkspaceWsep(ctx context.Context, client coder.Client, workspace *coder.Workspace) (*websocket.Conn, error)\n```\nDialWorkspaceWsep dials the executor endpoint using the [https://github.com/cdr/wsep](https://github.com/cdr/wsep) message protocol. The proper workspace provider envproxy access URL is used.\n\n```go\nfunc MakeImageMap(ctx context.Context, client coder.Client, workspaces []coder.Workspace) (map[string]*coder.Image, error)\n```\nMakeImageMap fetches all image entities specified in the slice of workspaces, then places them into an ID map.\n\n```go\nfunc MakeUserMap(ctx context.Context, client coder.Client, workspaces []coder.Workspace) (map[string]*coder.User, error)\n```\n\n```go\nfunc ProviderByName(ctx context.Context, client coder.Client, name string) (*coder.KubernetesProvider, error)\n```\nProviderByName searches linearly for a workspace provider by its name.\n\n## Types\n\n```go\ntype WorkspaceTable struct {\n\tName     string  `table:\"Name\" json:\"name\"`\n\tImage    string  `table:\"Image\" json:\"image\"`\n\tCPU      float32 `table:\"vCPU\" json:\"cpu\"`\n\tMemoryGB float32 `table:\"MemoryGB\" json:\"memory_gb\"`\n\tDiskGB   int     `table:\"DiskGB\" json:\"disk_gb\"`\n\tStatus   string  `table:\"Status\" json:\"status\"`\n\tProvider string  `table:\"Provider\" json:\"provider\"`\n\tCVM      bool    `table:\"CVM\" json:\"cvm\"`\n\tUsername string  `table:\"Username\" json:\"username\"`\n}\n```\nWorkspaceTable defines an Workspace-like structure with associated entities composed in a human readable form.\n\n```go\nfunc WorkspacesHumanTable(ctx context.Context, client coder.Client, workspaces []coder.Workspace) ([]WorkspaceTable, error)\n```\nWorkspacesHumanTable performs the composition of each Workspace with its associated ProviderName and ImageRepo.\n\n```go\ntype WorkspaceWithWorkspaceProvider struct {\n\tWorkspace         coder.Workspace\n\tWorkspaceProvider coder.KubernetesProvider\n}\n```\nWorkspaceWithWorkspaceProvider composes an Workspace entity with its associated WorkspaceProvider.\n\n```go\nfunc WorkspacesWithProvider(ctx context.Context, client coder.Client, workspaces []coder.Workspace) ([]WorkspaceWithWorkspaceProvider, error)\n```\nWorkspacesWithProvider performs the composition of each Workspace with its associated WorkspaceProvider.\n\n","path":"cdr.dev/coder-cli/internal/coderutil","name":"coderutil","synopsis":"Package coderutil providers utilities for high-level operations on coder-sdk entities.","isRedistributable":true}
