Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIfTargetLabelExists(label string) (bool, error)
- func Colorfy(msg string, fontcolor string, background string, effect string) string
- func ExtractProgramName(path string) string
- 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 PasswordFromReader(reader io.Reader) (string, error)
- func ReadTarget() (string, error)
- func ReadToken() (string, error)
- func RegisterExtraCmd(cmd Command)
- func SamlCallbackFailureMessage() string
- func SamlCallbackSuccessMessage() string
- func ShowServicesInstancesList(b []byte) ([]byte, error)
- func StreamJSONResponse(w io.Writer, response *http.Response) error
- func WriteOnTargetList(label, target string) error
- func WriteTarget(t string) error
- type APIRolePermissionData
- type APIUser
- type AppGuesser
- type Cancelable
- type Client
- type Command
- type ConfirmationCommand
- type Context
- type DeprecatedCommand
- type FlaggedCommand
- type GitGuesser
- type GuessingCommand
- type Info
- type Lookup
- type Manager
- type MapFlag
- type MapFlagWrapper
- type MultiGuesser
- type RemovedCommand
- type ServiceModel
- type ShellToContainerCmd
- type StringSliceFlag
- type StringSliceFlagWrapper
- type VerboseRoundTripper
Constants ¶
const (
VerbosityHeader = "X-Tsuru-Verbosity"
)
Variables ¶
var ( ErrAbortCommand = errors.New("") // ErrLookup is the error that should be returned by lookup functions when it // cannot find a matching command for the given parameters. ErrLookup = errors.New("lookup error - command not found") )
var GitHash = ""
Functions ¶
func ExtractProgramName ¶
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 RegisterExtraCmd ¶
func RegisterExtraCmd(cmd Command)
func SamlCallbackFailureMessage ¶
func SamlCallbackFailureMessage() string
func SamlCallbackSuccessMessage ¶
func SamlCallbackSuccessMessage() string
func StreamJSONResponse ¶
StreamJSONResponse supports the JSON streaming format from the tsuru API.
func WriteOnTargetList ¶
WriteOnTargetList writes the given target in the target list file.
func WriteTarget ¶
WriteTarget writes the given endpoint to the target file.
Types ¶
type APIRolePermissionData ¶
type APIUser ¶
type APIUser struct { Email string Roles []APIRolePermissionData Permissions []APIRolePermissionData }
APIUser is a user in the tsuru API.
func (*APIUser) PermissionInstances ¶
func (*APIUser) RoleInstances ¶
type AppGuesser ¶
AppGuesser is used to guess the name of an app based in a file path.
type Cancelable ¶
type Cancelable interface { // Cancel handles the command cancellation and is required to be thread safe as // this method is called by a different goroutine. // Cancel should return an error if the operation is not cancelable yet/anymore or there // was any error during the cancellation. // Cancel may be called multiple times. Cancel(context Context, client *Client) error }
Cancelable are implemented by commands that support cancellation
type Client ¶
type ConfirmationCommand ¶
type ConfirmationCommand struct {
// contains filtered or unexported fields
}
func (*ConfirmationCommand) Confirm ¶
func (cmd *ConfirmationCommand) Confirm(context *Context, question string) bool
func (*ConfirmationCommand) Flags ¶
func (cmd *ConfirmationCommand) Flags() *gnuflag.FlagSet
type DeprecatedCommand ¶
type DeprecatedCommand struct { Command // contains filtered or unexported fields }
func (*DeprecatedCommand) Flags ¶
func (c *DeprecatedCommand) Flags() *gnuflag.FlagSet
type FlaggedCommand ¶
type GitGuesser ¶
type GitGuesser struct{}
GitGuesser uses git to guess the name of the app.
It reads the "tsuru" remote from git config file. If the remote does not exist, or does not match the tsuru pattern (<user>@<somehost>:<app-name>.git), GuessName will return an error.
type GuessingCommand ¶
type GuessingCommand struct { G AppGuesser // contains filtered or unexported fields }
Embed this struct if you want your command to guess the name of the app.
func (*GuessingCommand) Flags ¶
func (cmd *GuessingCommand) Flags() *gnuflag.FlagSet
func (*GuessingCommand) Guess ¶
func (cmd *GuessingCommand) Guess() (string, error)
type Manager ¶
func BuildBaseManager ¶
func NewManager ¶
func (*Manager) RegisterDeprecated ¶
func (*Manager) RegisterRemoved ¶
func (*Manager) RegisterTopic ¶
type MapFlagWrapper ¶
func (MapFlagWrapper) Set ¶
func (f MapFlagWrapper) Set(val string) error
func (MapFlagWrapper) String ¶
func (f MapFlagWrapper) String() string
type MultiGuesser ¶
type MultiGuesser struct {
Guessers []AppGuesser
}
MultiGuesser can use multiple guessers
type RemovedCommand ¶
func (*RemovedCommand) Info ¶
func (c *RemovedCommand) Info() *Info
type ServiceModel ¶
type ShellToContainerCmd ¶
type ShellToContainerCmd struct { GuessingCommand // contains filtered or unexported fields }
func (*ShellToContainerCmd) Flags ¶
func (c *ShellToContainerCmd) Flags() *gnuflag.FlagSet
func (*ShellToContainerCmd) Info ¶
func (c *ShellToContainerCmd) Info() *Info
type StringSliceFlag ¶
type StringSliceFlag []string
func (*StringSliceFlag) Set ¶
func (f *StringSliceFlag) Set(val string) error
func (*StringSliceFlag) String ¶
func (f *StringSliceFlag) String() string
type StringSliceFlagWrapper ¶
type StringSliceFlagWrapper struct {
Dst *[]string
}
func (StringSliceFlagWrapper) Set ¶
func (f StringSliceFlagWrapper) Set(val string) error
func (StringSliceFlagWrapper) String ¶
func (f StringSliceFlagWrapper) String() string
type VerboseRoundTripper ¶
type VerboseRoundTripper struct { http.RoundTripper Verbosity *int Writer io.Writer }
VerboseRoundTripper is a RoundTripper that dumps request and response based on the Verbosity. Verbosity >= 1 --> Dumps request Verbosity >= 2 --> Dumps response