Documentation
¶
Overview ¶
This package holds majority of actual functionality of rcc, in form of "operations" that can be done.
Index ¶
- Constants
- func AccountByName(label string) *account
- func BackgroundAssistantHeartbeat(cancel chan bool, client cloud.Client, account *account, ...)
- func BearerToken(token string) string
- func BeatAssistantRun(client cloud.Client, account *account, workspaceId, assistantId, runId string, ...) error
- func CacheRobot(filename string) error
- func CarrierUnzip(directory, carrier string, force, temporary bool) error
- func CleanupOldestRobot()
- func CommunityLocation(name, branch string) string
- func Decoded(content string) ([]byte, error)
- func DefaultAccountName() string
- func DeleteAccount(client cloud.Client, account *account) error
- func Digest(incoming string) string
- func DownloadCommand(client cloud.Client, account *account, workspaceId, robotId, zipfile string, ...) error
- func DownloadCommunityRobot(url, filename string) error
- func ExecuteSimpleTask(flags *RunFlags, template []string, config robot.Robot, todo robot.Task, ...)
- func ExecuteTask(flags *RunFlags, template []string, config robot.Robot, todo robot.Task, ...)
- func ExecutionEnvironmentListing(wantedfile, label string, searchPath pathlib.PathParts, ...) bool
- func FindExecutable() (string, error)
- func FixDirectory(dir string) error
- func FixRobot(robotFile string) error
- func FreezeEnvironmentListing(label string, config robot.Robot)
- func HasPayload(filename string) (bool, error)
- func HmacSignature(claims *Claims, secret, nonce, bodyHash string) string
- func HololibZipShape(file *zip.File) error
- func InitializeWorkarea(directory, name string, internal, force bool) error
- func IoAsString(source io.Reader) string
- func IsCarrier() (bool, error)
- func ListAccounts(json bool)
- func ListTemplates(internal bool) []string
- func LoadAnyTaskEnvironment(packfile string, force bool) (bool, robot.Robot, robot.Task, string)
- func LoadTaskWithEnvironment(packfile, theTask string, force bool) (bool, robot.Robot, robot.Task, string)
- func LookupRobot(digest string) (string, bool)
- func MultipartUpload(url string, fields map[string]string, basename, fullpath string) error
- func NiceJsonOutput(content interface{}) (string, error)
- func OldestRobot() (string, time.Time)
- func PrintRobotDiagnostics(robotfile string, json, production bool) error
- func ProduceDiagnostics(filename, robotfile string, json, production, quick bool) (*common.DiagnosticStatus, error)
- func ProduceNetDiagnostics(body []byte, json bool) (*common.DiagnosticStatus, error)
- func ProductCloudHmac(identifier, token string) string
- func ProtectedImport(filename string) (err error)
- func PullCatalog(origin, catalogName string, useLock bool) (err error)
- func RccVersionCheck() func()
- func ReportIssue(email, robotFile, reportFile string, attachmentsFiles []string, dryrun bool) error
- func RunRobotDiagnostics(robotfile string, production bool) *common.DiagnosticStatus
- func SelectExecutionModel(runFlags *RunFlags, simple bool, template []string, config robot.Robot, ...)
- func SelfAppend(target, payload string) error
- func SelfCopy(target string) error
- func SetDefaultAccount(account string)
- func StopAssistantRun(client cloud.Client, account *account, ...) error
- func SubprocessWarning(seen ChildMap, use bool) error
- func SummonRobotZipfile(client cloud.Client, account *account, workspaceId, robotId, digest string) (string, error)
- func TLSExport(filename string, configfiles []string) (err error)
- func TLSProbe(serverports []string) (err error)
- func TemplatesZip() string
- func ToUnix(content []byte) []byte
- func Unzip(directory, zipfile string, force, temporary, flatten bool) error
- func UpdateCredentials(account, endpoint, identifier, secret string)
- func UploadCommand(client cloud.Client, account *account, workspaceId, robotId, zipfile string, ...) error
- func VerifyAccounts(force bool)
- func VerifyZip(zipfile string, verifier Verifier) []error
- func WatchChildren(pid int, delay time.Duration) chan ChildMap
- func WorkspaceToken(token string) string
- func WorkspaceTreeCommand(client cloud.Client, account *account, workspace string) (interface{}, error)
- func WorkspaceTreeCommandRequest(client cloud.Client, account *account, workspace string) (*cloud.Response, error)
- func WorkspacesCommand(client cloud.Client, account *account) (interface{}, error)
- func Zip(directory, zipfile string, ignores []string) error
- func ZipAppend(writer *zip.Writer, fullpath, relativepath string) error
- type ArtifactPublisher
- type AssistantRobot
- type Cache
- type ChildMap
- type Claims
- func DeleteClaims() *Claims
- func EditRobotClaims(seconds int, workspace string) *Claims
- func GetRobotClaims(seconds int, workspace string) *Claims
- func NewClaims(name, url string, expires int) *Claims
- func RunAssistantClaims(seconds int, workspace string) *Claims
- func RunRobotClaims(seconds int, workspace string) *Claims
- func VerificationClaims() *Claims
- func ViewWorkspacesClaims(seconds int) *Claims
- type Command
- type CommandChannel
- type CompletedChannel
- type Configuration
- type Credential
- type CredentialMap
- type EncryptionKeys
- type EncryptionPayload
- type EncryptionV1
- type Ephemeral
- type MetaTemplates
- type NetConfig
- type ProcessMap
- type ProcessNode
- type ProcessNodes
- type ReaderCloserAt
- type RobotData
- type RunFlags
- type StampMap
- type StringMap
- type StringPair
- type StringPairList
- type Token
- func AuthorizeClaims(accountName string, claims *Claims, period *TokenPeriod) (Token, error)
- func AuthorizeCommand(client cloud.Client, account *account, claims *Claims, period *TokenPeriod) (Token, error)
- func ListAssistantsCommand(client cloud.Client, account *account, workspaceId string) ([]Token, error)
- func NewRobotCommand(client cloud.Client, account *account, workspace, robotName string) (Token, error)
- type TokenPeriod
- type Unmarshaler
- type UrlConfig
- type UserInfo
- type Verifier
- type WebConfig
- type WorkspaceTreeData
- type WriteTarget
Constants ¶
View Source
const ( WorkspaceApi = `/token-vendor-v1/workspaces/%s/tokenrequest` UserApi = `/token-vendor-v1/user/tokenrequest` UserDetails = `/token-vendor-v1/user/details` DeleteCredentials = `/token-vendor-v1/credential` )
View Source
const ( X_RCC_RANDOM_IDENTITY = `X-Rcc-Random-Identity` AUTHORIZATION = "Authorization" )
Variables ¶
This section is empty.
Functions ¶
func AccountByName ¶
func AccountByName(label string) *account
func BearerToken ¶
func BeatAssistantRun ¶
func CacheRobot ¶
func CarrierUnzip ¶
func CleanupOldestRobot ¶
func CleanupOldestRobot()
func CommunityLocation ¶
func DefaultAccountName ¶
func DefaultAccountName() string
func DeleteAccount ¶
func DownloadCommand ¶
func DownloadCommunityRobot ¶
func ExecuteSimpleTask ¶
func ExecuteTask ¶
func FindExecutable ¶
func FixDirectory ¶
func HasPayload ¶
func HmacSignature ¶
func HololibZipShape ¶
func InitializeWorkarea ¶
func IoAsString ¶
func ListAccounts ¶
func ListAccounts(json bool)
func ListTemplates ¶
func LoadAnyTaskEnvironment ¶
func LoadTaskWithEnvironment ¶
func LookupRobot ¶
func MultipartUpload ¶
func NiceJsonOutput ¶
func OldestRobot ¶
func PrintRobotDiagnostics ¶
func ProduceDiagnostics ¶
func ProduceDiagnostics(filename, robotfile string, json, production, quick bool) (*common.DiagnosticStatus, error)
func ProduceNetDiagnostics ¶
func ProduceNetDiagnostics(body []byte, json bool) (*common.DiagnosticStatus, error)
func ProductCloudHmac ¶
func ProtectedImport ¶
func PullCatalog ¶
func RccVersionCheck ¶
func RccVersionCheck() func()
func ReportIssue ¶
func RunRobotDiagnostics ¶
func RunRobotDiagnostics(robotfile string, production bool) *common.DiagnosticStatus
func SelectExecutionModel ¶
func SelfAppend ¶
func SetDefaultAccount ¶
func SetDefaultAccount(account string)
func StopAssistantRun ¶
func SubprocessWarning ¶
func SummonRobotZipfile ¶
func TemplatesZip ¶
func TemplatesZip() string
func UpdateCredentials ¶
func UpdateCredentials(account, endpoint, identifier, secret string)
func UploadCommand ¶
func VerifyAccounts ¶
func VerifyAccounts(force bool)
func WorkspaceToken ¶
func WorkspaceTreeCommand ¶
func WorkspacesCommand ¶
Types ¶
type ArtifactPublisher ¶
type AssistantRobot ¶
type AssistantRobot struct { WorkspaceId string AssistantId string RunId string RobotId string TaskName string Zipfile string Environment map[string]string Details map[string]interface{} Config map[string]interface{} ArtifactURL string }
func StartAssistantRun ¶
func StartAssistantRun(client cloud.Client, account *account, workspaceId, assistantId string) (*AssistantRobot, error)
type Cache ¶
type Cache struct { Credentials CredentialMap `yaml:"credentials"` Stamps StampMap `yaml:"stamps"` Users []string `yaml:"users"` }
func SummonCache ¶
type Claims ¶
type Claims struct { ExpiresIn int `json:"expiresIn,omitempty"` CapabilitySet string `json:"capabilitySet,omitempty"` Method string `json:"-"` Url string `json:"-"` Name string `json:"-"` }
func DeleteClaims ¶
func DeleteClaims() *Claims
func EditRobotClaims ¶
func GetRobotClaims ¶
func RunAssistantClaims ¶
func RunRobotClaims ¶
func VerificationClaims ¶
func VerificationClaims() *Claims
func ViewWorkspacesClaims ¶
type CommandChannel ¶
type CommandChannel chan Command
type CompletedChannel ¶
type CompletedChannel chan bool
type Configuration ¶
type Configuration struct {
Network *NetConfig `yaml:"network"`
}
type Credential ¶
type CredentialMap ¶
type CredentialMap map[string]*Credential
type EncryptionKeys ¶
type EncryptionPayload ¶
type EncryptionPayload struct { Encryption *EncryptionKeys `json:"encryption"` Payload string `json:"payload,omitempty"` }
type EncryptionV1 ¶
type EncryptionV1 struct {
*rsa.PrivateKey
}
func (*EncryptionV1) PublicPEM ¶
func (it *EncryptionV1) PublicPEM() string
func (*EncryptionV1) RequestBody ¶
func (it *EncryptionV1) RequestBody(payload interface{}) (io.Reader, error)
func (*EncryptionV1) RequestObject ¶
func (it *EncryptionV1) RequestObject(payload interface{}) ([]byte, error)
type Ephemeral ¶
type Ephemeral interface { RequestBody(interface{}) (io.Reader, error) Decode([]byte) ([]byte, error) }
func GenerateEphemeralKey ¶
type MetaTemplates ¶
type MetaTemplates struct { Date string `yaml:"date"` Hash string `yaml:"hash"` Templates StringMap `yaml:"templates"` Url string `yaml:"url"` }
func TemplateInfo ¶
func TemplateInfo(filename string) (ingore *MetaTemplates, err error)
func (*MetaTemplates) MatchingHash ¶
func (it *MetaTemplates) MatchingHash(hash string) bool
type NetConfig ¶
type ProcessMap ¶
type ProcessMap map[int]*ProcessNode
func ProcessMapNow ¶
func ProcessMapNow() (ProcessMap, error)
func (ProcessMap) Keys ¶
func (it ProcessMap) Keys() []int
func (ProcessMap) Roots ¶
func (it ProcessMap) Roots() []int
type ProcessNode ¶
type ProcessNode struct { Pid int Parent int White bool Executable string Children ProcessMap }
func NewProcessNode ¶
func NewProcessNode(core ps.Process) *ProcessNode
type ProcessNodes ¶
type ProcessNodes []*ProcessNode
type ReaderCloserAt ¶
func PayloadReaderAt ¶
func PayloadReaderAt(filename string) (ReaderCloserAt, error)
type StringPair ¶
type StringPair [2]string
type StringPairList ¶
type StringPairList []StringPair
func ListTemplatesWithDescription ¶
func ListTemplatesWithDescription(internal bool) StringPairList
func (StringPairList) Len ¶
func (it StringPairList) Len() int
func (StringPairList) Less ¶
func (it StringPairList) Less(left, right int) bool
func (StringPairList) Swap ¶
func (it StringPairList) Swap(left, right int)
type Token ¶
type Token map[string]interface{}
func AuthorizeClaims ¶
func AuthorizeClaims(accountName string, claims *Claims, period *TokenPeriod) (Token, error)
func AuthorizeCommand ¶
func ListAssistantsCommand ¶
func NewRobotCommand ¶
type TokenPeriod ¶
func DefaultTokenPeriod ¶
func DefaultTokenPeriod() *TokenPeriod
func (*TokenPeriod) Deadline ¶
func (it *TokenPeriod) Deadline() int64
func (*TokenPeriod) EnforceGracePeriod ¶
func (it *TokenPeriod) EnforceGracePeriod() *TokenPeriod
func (*TokenPeriod) Liveline ¶
func (it *TokenPeriod) Liveline() int64
func (*TokenPeriod) RequestSeconds ¶
func (it *TokenPeriod) RequestSeconds() int
type Unmarshaler ¶
type WorkspaceTreeData ¶
type WriteTarget ¶
func (*WriteTarget) Execute ¶
func (it *WriteTarget) Execute() bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.