Documentation ¶
Index ¶
- Variables
- func CheckIfTargetLabelExists(label string) (bool, error)
- func Filesystem() fs.Fs
- func GetTarget() (string, error)
- func GetTargetLabel() (string, error)
- func GetURL(path string) (string, error)
- func GetURLVersion(version, path string) (string, error)
- func JoinWithUserDir(p ...string) string
- func MergeFlagSet(fs1, fs2 *gnuflag.FlagSet) *gnuflag.FlagSet
- func ReadTarget() (string, error)
- func ReadTeamToken() string
- func ReadTokenV1() (string, error)
- func RemoveTokenV1() error
- func RemoveTokenV2() error
- func ResetFileSystem()
- func SaveChangesNoPrint() error
- func SaveChangesWithTimeout()
- func SetFileSystem(f fs.Fs)
- func WriteOnTargetList(label, target string) error
- func WriteTarget(t string) error
- func WriteTokenV1(token string) error
- func WriteTokenV2(token TokenV2) error
- type ClientSelfUpdater
- type ConfigType
- type TargetAdd
- type TargetList
- type TargetRemove
- type TargetSet
- type TokenProvider
- type TokenV2
Constants ¶
This section is empty.
Variables ¶
View Source
var (
SchemaVersion string = "0.1"
)
Functions ¶
func Filesystem ¶
func GetTargetLabel ¶
func GetURLVersion ¶
func JoinWithUserDir ¶
func ReadTarget ¶
ReadTarget returns the current target, as defined in the TSURU_TARGET environment variable or in the target file.
func ReadTeamToken ¶
func ReadTeamToken() string
func ReadTokenV1 ¶
func RemoveTokenV1 ¶
func RemoveTokenV1() error
func RemoveTokenV2 ¶
func RemoveTokenV2() error
func ResetFileSystem ¶
func ResetFileSystem()
func SaveChangesNoPrint ¶
func SaveChangesNoPrint() error
func SaveChangesWithTimeout ¶
func SaveChangesWithTimeout()
SaveChangesWithTimeout will try to save changes on ~/.tsuru/config.json and it will timeout after 1s (default). Timeout is overridden from env TSURU_CLIENT_LOCAL_TIMEOUT
func SetFileSystem ¶
func WriteOnTargetList ¶
WriteOnTargetList writes the given target in the target list file.
func WriteTarget ¶
WriteTarget writes the given endpoint to the target file.
func WriteTokenV1 ¶
func WriteTokenV2 ¶
Types ¶
type ClientSelfUpdater ¶
ClientSelfUpdater saves configuration regarding self updating the client
type ConfigType ¶
type ConfigType struct { SchemaVersion string LastUpdate time.Time // ---- public confs ---- ClientSelfUpdater ClientSelfUpdater // contains filtered or unexported fields }
ConfigType is the main config, serialized to ~/.tsuru/config.json
type TargetList ¶
type TargetList struct{}
func (*TargetList) Info ¶
func (t *TargetList) Info() *cmd.Info
type TargetRemove ¶
type TargetRemove struct{}
func (*TargetRemove) Info ¶
func (t *TargetRemove) Info() *cmd.Info
type TokenProvider ¶
type TokenProvider interface { // Token returns the content of header authorization, useful to propagate token to third parties such as plugins and websocket Token() (string, error) }
var DefaultTokenProvider TokenProvider = TokenProviderV1()
func TokenProviderV1 ¶
func TokenProviderV1() TokenProvider
Click to show internal directories.
Click to hide internal directories.