{"modulePath":"code.cloudfoundry.org/cli-sapi","version":"v6.51.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package sharedaction\n\nPackage sharedaction handles all operations that do not require a cloud controller\n\n## Constants\n\n```go\nconst (\n\tStagingLog      = \"STG\"\n\tRecentLogsLines = 1000\n)\n```\n\n```go\nconst (\n\tDefaultFolderPermissions      = 0755\n\tDefaultArchiveFilePermissions = 0744\n\tMaxResourceMatchChunkSize     = 1000\n)\n```\n\n## Variables\n\n```go\nvar DefaultIgnoreLines = []string{\n\t\".cfignore\",\n\t\".DS_Store\",\n\t\".git\",\n\t\".gitignore\",\n\t\".hg\",\n\t\".svn\",\n\t\"_darcs\",\n\t\"manifest.yaml\",\n\t\"manifest.yml\",\n}\n```\n\n## Functions\n\n```go\nfunc GetStreamingLogs(appGUID string, client LogCacheClient) (\u003c-chan LogMessage, \u003c-chan error, context.CancelFunc)\n```\n\n## Types\n\n```go\ntype Actor struct {\n\tConfig Config\n}\n```\nActor handles all shared actions\n\n```go\nfunc NewActor(config Config) *Actor\n```\nNewActor returns an Actor with default settings\n\n```go\nfunc (actor Actor) CheckTarget(targetedOrganizationRequired bool, targetedSpaceRequired bool) error\n```\nCheckTarget confirms that the user is logged in. Optionally it will also check if an organization and space are targeted.\n\n```go\nfunc (Actor) CommandInfoByName(commandList interface{}, commandName string) (CommandInfo, error)\n```\nCommandInfoByName returns the help information for a particular commandName in the commandList.\n\n```go\nfunc (Actor) CommandInfos(commandList interface{}) map[string]CommandInfo\n```\nCommandInfos returns a slice of CommandInfo that only fills in the Name and Description for all the commands in commandList\n\n```go\nfunc (actor Actor) CreateArchive(bitsPath string, resources []Resource) (io.ReadCloser, int64, error)\n```\n\n```go\nfunc (actor Actor) ExecuteSecureShell(sshClient SecureShellClient, sshOptions SSHOptions) error\n```\n\n```go\nfunc (actor Actor) GatherArchiveResources(archivePath string) ([]Resource, error)\n```\nGatherArchiveResources returns a list of resources for an archive.\n\n```go\nfunc (actor Actor) GatherDirectoryResources(sourceDir string) ([]Resource, error)\n```\nGatherDirectoryResources returns a list of resources for a directory.\n\n```go\nfunc (actor Actor) IsLoggedIn() bool\n```\nIsLoggedIn checks whether a user has authenticated with CF\n\n```go\nfunc (actor Actor) IsOrgTargeted() bool\n```\nIsOrgTargeted determines whether an org is being targeted by the CLI\n\n```go\nfunc (actor Actor) IsSpaceTargeted() bool\n```\nIsSpaceTargeted determines whether a space is being targeted by the CLI\n\n```go\nfunc (Actor) ReadArchive(archivePath string) (io.ReadCloser, int64, error)\n```\n\n```go\nfunc (actor Actor) RequireCurrentUser() (string, error)\n```\n\n```go\nfunc (actor Actor) RequireTargetedOrg() (string, error)\n```\n\n```go\nfunc (actor Actor) ZipArchiveResources(sourceArchivePath string, filesToInclude []Resource) (string, error)\n```\nZipArchiveResources zips an archive and a sorted (based on full path/filename) list of resources and returns the location. On Windows, the filemode for user is forced to be readable and executable.\n\n```go\nfunc (actor Actor) ZipDirectoryResources(sourceDir string, filesToInclude []Resource) (string, error)\n```\nZipDirectoryResources zips a directory and a sorted (based on full path/filename) list of resources and returns the location. On Windows, the filemode for user is forced to be readable and executable.\n\n```go\ntype CommandFlag struct {\n\t// Short is the short form of the flag\n\tShort string\n\n\t// Long is the long form of the flag\n\tLong string\n\n\t// Description is the description of the flag\n\tDescription string\n\n\t// Default is the flag's default value\n\tDefault string\n}\n```\nCommandFlag contains the help details of a command's flag\n\n```go\ntype CommandInfo struct {\n\t// Name is the command name\n\tName string\n\n\t// Description is the command description\n\tDescription string\n\n\t// Alias is the command alias\n\tAlias string\n\n\t// Usage is the command usage string, may contain examples and flavor text\n\tUsage string\n\n\t// RelatedCommands is a list of commands related to the command\n\tRelatedCommands []string\n\n\t// Flags contains the list of flags for this command\n\tFlags []CommandFlag\n\n\t// Environment is a list of environment variables specific for this command\n\tEnvironment []EnvironmentVariable\n}\n```\nCommandInfo contains the help details of a command\n\n```go\ntype Config interface {\n\tAccessToken() string\n\tBinaryName() string\n\tCurrentUserName() (string, error)\n\tHasTargetedOrganization() bool\n\tHasTargetedSpace() bool\n\tRefreshToken() string\n\tTargetedOrganizationName() string\n\tVerbose() (bool, []string)\n}\n```\nConfig a way of getting basic CF configuration\n\n```go\ntype EnvironmentVariable struct {\n\tName         string\n\tDescription  string\n\tDefaultValue string\n}\n```\nEnvironmentVariable contains env vars specific for this command\n\n```go\ntype LocalPortForward clissh.LocalPortForward\n```\n\n```go\ntype LogCacheClient interface {\n\tRead(\n\t\tctx context.Context,\n\t\tsourceID string,\n\t\tstart time.Time,\n\t\topts ...logcache.ReadOption,\n\t) ([]*loggregator_v2.Envelope, error)\n}\n```\nLogCacheClient is a client for getting logs.\n\n```go\ntype LogMessage struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc GetRecentLogs(appGUID string, client LogCacheClient) ([]LogMessage, error)\n```\n\n```go\nfunc NewLogMessage(message string, messageType string, timestamp time.Time, sourceType string, sourceInstance string) *LogMessage\n```\n\n```go\nfunc (log LogMessage) Message() string\n```\n\n```go\nfunc (log LogMessage) SourceInstance() string\n```\n\n```go\nfunc (log LogMessage) SourceType() string\n```\n\n```go\nfunc (log LogMessage) Staging() bool\n```\n\n```go\nfunc (log LogMessage) Timestamp() time.Time\n```\n\n```go\nfunc (log LogMessage) Type() string\n```\n\n```go\ntype LogMessages []*LogMessage\n```\n\n```go\nfunc (lm LogMessages) Len() int\n```\n\n```go\nfunc (lm LogMessages) Less(i, j int) bool\n```\n\n```go\nfunc (lm LogMessages) Swap(i, j int)\n```\n\n```go\ntype Resource struct {\n\tFilename string      `json:\"fn\"`\n\tMode     os.FileMode `json:\"mode\"`\n\tSHA1     string      `json:\"sha1\"`\n\tSize     int64       `json:\"size\"`\n}\n```\n\n```go\nfunc (r Resource) ToV3Resource() V3Resource\n```\nToV3Resource converts a sharedaction Resource to V3 Resource format\n\n```go\ntype SSHOptions struct {\n\tCommands              []string\n\tUsername              string\n\tPasscode              string\n\tEndpoint              string\n\tHostKeyFingerprint    string\n\tSkipHostValidation    bool\n\tSkipRemoteExecution   bool\n\tTTYOption             TTYOption\n\tLocalPortForwardSpecs []LocalPortForward\n}\n```\n\n```go\ntype SecureShellClient interface {\n\tConnect(username string, passcode string, sshEndpoint string, sshHostKeyFingerprint string, skipHostValidation bool) error\n\tClose() error\n\tInteractiveSession(commands []string, terminalRequest clissh.TTYRequest) error\n\tLocalPortForward(localPortForwardSpecs []clissh.LocalPortForward) error\n\tWait() error\n}\n```\n\n```go\ntype TTYOption clissh.TTYRequest\n```\n\n```go\nconst (\n\tRequestTTYAuto TTYOption = iota\n\tRequestTTYNo\n\tRequestTTYYes\n\tRequestTTYForce\n)\n```\n\n```go\ntype V3Resource ccv3.Resource\n```\n\n```go\nfunc (r V3Resource) ToV2Resource() Resource\n```\nToV2Resource converts a V3 Resource to V2 Resource format\n\n","path":"code.cloudfoundry.org/cli-sapi/actor/sharedaction","name":"sharedaction","synopsis":"Package sharedaction handles all operations that do not require a cloud controller","isRedistributable":true}
