Skip to content

Commit

Permalink
refactor(puppetservice): remove hostie nv (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
dchaofei authored Dec 8, 2023
1 parent 149e07c commit 6e2107c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
27 changes: 0 additions & 27 deletions wechaty-puppet-service/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,6 @@ package puppetservice

import (
logger "github.com/wechaty/go-wechaty/wechaty-puppet/log"
"os"
)

var (
// WechatyPuppetHostieToken ...
// Deprecated: please use WechatyPuppetServiceToken TODO:will be deleted in the future
WechatyPuppetHostieToken string

// WechatyPuppetHostieEndpoint ...
// Deprecated: please use WechatyPuppetHostieEndpoint TODO:will be deleted in the future
WechatyPuppetHostieEndpoint string

// WechatyPuppetServiceToken ...
// Deprecated
WechatyPuppetServiceToken string

// WechatyPuppetServiceEndpoint ...
// Deprecated
WechatyPuppetServiceEndpoint string
)

var log = logger.L.WithField("module", "wechaty-puppet-service")

func init() {
WechatyPuppetHostieToken, _ = os.LookupEnv("WECHATY_PUPPET_HOSTIE_TOKEN")
WechatyPuppetHostieEndpoint, _ = os.LookupEnv("WECHATY_PUPPET_HOSTIE_ENDPOINT")

WechatyPuppetServiceToken, _ = os.LookupEnv("WECHATY_PUPPET_SERVICE_TOKEN")
WechatyPuppetServiceEndpoint, _ = os.LookupEnv("WECHATY_PUPPET_SERVICE_ENDPOINT")
}
13 changes: 0 additions & 13 deletions wechaty-puppet-service/envvars.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ func envServiceToken(token string) (string, error) {
return token, nil
}

token = os.Getenv("WECHATY_PUPPET_HOSTIE_TOKEN")
if token != "" {
log.Trace("WECHATY_PUPPET_HOSTIE_TOKEN has been deprecated," +
"please use WECHATY_PUPPET_SERVICE_TOKEN instead.")
return token, nil
}

return "", ErrTokenNotFound
}

Expand All @@ -38,12 +31,6 @@ func envEndpoint(endpoint string) string {
return endpoint
}

endpoint = os.Getenv("WECHATY_PUPPET_HOSTIE_ENDPOINT")
if endpoint != "" {
log.Println("WECHATY_PUPPET_HOSTIE_ENDPOINT has been deprecated," +
"please use WECHATY_PUPPET_SERVICE_ENDPOINT instead.")
return endpoint
}
return ""
}

Expand Down

0 comments on commit 6e2107c

Please sign in to comment.