github.com/pluralsh/plural-cli@v0.9.5/pkg/api/shell.go (about) 1 package api 2 3 import "fmt" 4 5 func (client *client) GetShell() (CloudShell, error) { 6 resp, err := client.pluralClient.GetShell(client.ctx) 7 if err != nil { 8 return CloudShell{}, err 9 } 10 11 if resp.Shell != nil { 12 return CloudShell{ 13 Id: resp.Shell.ID, 14 AesKey: resp.Shell.AesKey, 15 GitUrl: resp.Shell.GitURL, 16 }, nil 17 } 18 return CloudShell{}, fmt.Errorf("Could not find a cloud shell for this user") 19 } 20 21 func (client *client) DeleteShell() error { 22 _, err := client.pluralClient.DeleteShell(client.ctx) 23 if err != nil { 24 return err 25 } 26 27 return nil 28 }