Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
djelusic committed Sep 30, 2021
1 parent 76de882 commit 0e39080
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 53 deletions.
15 changes: 2 additions & 13 deletions workspace/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ import (
)

const (
configDir = "config"
configName = "project.yml"
configS3Key = "config/project.yml"
defaultStage = "dev"
TokenLength = 40
configDir = "config"
configName = "project.yml"
)

const (
Expand All @@ -28,14 +25,6 @@ type Project struct {
Stages []*Stage `yaml:"stages,omitempty"`
}

type UpdateAction uint8

const (
Add UpdateAction = 0
Remove UpdateAction = 1
Update UpdateAction = 2
)

func SaveProject(p *Project, basePath string) error {
buf, err := yaml.Marshal(p)
if err != nil {
Expand Down
40 changes: 0 additions & 40 deletions workspace/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ func CreateConfigDir() error {
return err
}

func RemoveConfigDir() error {
home, err := os.UserHomeDir()
if err != nil {
return err
}
return os.RemoveAll(fmt.Sprintf("%s/.mantil", home))
}

func workspaceConfigPath() (string, error) {
name := defaultWorkspaceName()
home, err := os.UserHomeDir()
Expand Down Expand Up @@ -176,35 +168,3 @@ func (w *Workspace) Account(name string) *Account {
}
return nil
}

func RestEndpoint(accountName string) (string, error) {
config, err := Load()
if err != nil {
return "", err
}
account := config.Account(accountName)
if account == nil {
return "", fmt.Errorf("account not found")
}
return account.Endpoints.Rest, nil
}

func WsEndpoint(accountName string) (string, error) {
config, err := Load()
if err != nil {
return "", err
}
account := config.Account(accountName)
if account == nil {
return "", fmt.Errorf("account not found")
}
return fmt.Sprintf("%s/$default", account.Endpoints.Ws), nil
}

func DefaultRestEndpoint() (string, error) {
return RestEndpoint(DefaultAccountName)
}

func DefaultWsEndpoint() (string, error) {
return WsEndpoint(DefaultAccountName)
}

0 comments on commit 0e39080

Please sign in to comment.