Documentation ¶
Index ¶
- Constants
- Variables
- func GetActiveProjectPath() (string, error)
- func GetGlobalConfigPath() string
- func GetProjectOwnerAndName() (owner string, name string)
- func GetUnweaveSSHKeysFolder() string
- func GetVolumeAttachParams() ([]types.VolumeAttachParams, error)
- func Init()
- func InitProjectConfigFrom(projectConfigPath, envConfigPath string) (*Secrets, *Project)
- func InitUnweaveClient() *client.Client
- func IsProjectLinked() bool
- func ProjectHostDir() string
- func WriteEnvConfig() error
- func WriteGitignore() error
- func WriteProjectConfig(projectURI string, providers []string) error
- type Project
- type Secrets
- type Spec
Constants ¶
const ( GlobalConfigDirName = ".unweave_global" ProjectConfigDirName = ".unweave" UnweaveSSHKeysDir = ".unweave_global/.ssh" )
const DefaultVolumeSize = 4
const UnweaveHostDir = "/home/unweave"
UnweaveHostDir is the filesystem location where your code gets stored on the host. Adjust this as you need.
Variables ¶
var ( // Version is added at build time Version = "dev" Config = &config{ Unweave: &unweave{ ApiURL: "https://api.unweave.io", AppURL: "https://app.unweave.io", User: &user{}, }, Project: &Project{ Env: &Secrets{}, Providers: map[string]provider{}, }, } )
var All = false
All can be used across multiple commands. Example: unweave ls --all to list all projects
var AuthToken = ""
AuthToken is used to authenticate with the Unweave API. It is loaded from the saved config file and can be overridden with runtime flags.
var BuildID = ""
BuildID is the ID of the build to use when running commands that require a build.
var CPUs int
CPUs is the number of VCPUs to allocate.
var Command string
Command is the user supplied command that should be run in the exec.
var CreateExec = true
CreateExec is used to denote whether to create a new exec when running commands that require a exec.
var DefaultNodeTypes = []string{}
var EndpointName string
EndpointName is the name of the endpoint we operate on when calling deploy or create if it doesn't exist.
var ExecAttach = false
ExecAttach is used to determine if the exec command should stay attached to the exec after starting the command.
var FollowLogs = false
FollowLogs denotes if the logs command should stay attached and print logs as they come in. Default false, which means print only the logs received so far.
var GPUMemory int
GPUMemory is the memory of GPU if applicable for a gpuType.
var GPUType string
GPUType is the type of GPU to use.
var GPUs int
GPUs is the number of GPUs to allocate for a gpuType.
var HDD int
HDD is the amount of storage to allocate in GB.
var InternalPort int32
InternalPort is the port that should be exposed as https
var Memory int
Memory is the amount of RAM to allocate in GB.
var NoCopySource = true
NoCopySource is a bool to denote whether to copy the source code to the session
var NodeRegion = ""
NodeRegion is the region to use when creating a new session
var ProjectURI = ""
ProjectURI is the project slug with syntax `<owner>/<project` of the project to run commands on. It is loaded from the saved config file and can be overridden with runtime flags.
var Provider = ""
Provider is the provider to use when executing a request
var SSHConnectionOptions []string
SSHConnectionOptions is the arguments you want to include when opening an SSH session.
var SSHKeyName = ""
SSHKeyName is the name of the SSH Key already configured in Unweave to use for a new or existing Exec.
var SSHPrivateKeyPath = ""
SSHPrivateKeyPath is the path to the SSH public key to use to connect to a new or existing Exec.
var SSHPublicKeyPath = ""
SSHPublicKeyPath is the path to the SSH public key to use to connect to a new or existing Exec.
var SpecName string
SpecName is the name of the spec from config to use.
var Volumes []string
Volumes is a list of volumes to mount to the session
Functions ¶
func GetActiveProjectPath ¶ added in v0.1.8
GetActiveProjectPath returns the active project directory by recursively going up the directory tree until it finds a directory that's contains the .unweave/config.toml file
func GetGlobalConfigPath ¶ added in v0.1.24
func GetGlobalConfigPath() string
func GetProjectOwnerAndName ¶ added in v0.1.9
func GetUnweaveSSHKeysFolder ¶ added in v0.1.28
func GetUnweaveSSHKeysFolder() string
func GetVolumeAttachParams ¶ added in v0.1.36
func GetVolumeAttachParams() ([]types.VolumeAttachParams, error)
GetVolumeAttachParams reads the existing config and
func InitProjectConfigFrom ¶ added in v0.1.40
func InitUnweaveClient ¶ added in v0.1.28
func IsProjectLinked ¶ added in v0.0.5
func IsProjectLinked() bool
func ProjectHostDir ¶ added in v0.1.34
func ProjectHostDir() string
ProjectHostDir is the location where project files get copied to
func WriteEnvConfig ¶ added in v0.0.5
func WriteEnvConfig() error
func WriteGitignore ¶ added in v0.0.5
func WriteGitignore() error