Documentation ¶
Index ¶
- Variables
- type GithubClient
- func (c *GithubClient) GetKeys(userName string) (keys []*github.Key, err error)
- func (c *GithubClient) GetOrg() (org string)
- func (c *GithubClient) GetTeam(name string, id int64) (team *github.Team, err error)
- func (c *GithubClient) GetTeamMembers(org string, team *github.Team) (users []*github.User, err error)
- func (c *GithubClient) IsTeamMember(org string, user string, team *github.Team) (bool, error)
- type Linux
- func (linux *Linux) Command(name string, params ...string) *exec.Cmd
- func (linux *Linux) FileCreate(filePath string) error
- func (linux *Linux) FileDelete(filePath string) error
- func (linux *Linux) FileEnsure(filePath, content string) error
- func (linux *Linux) FileEnsureLine(filePath string, line string) error
- func (linux *Linux) FileEnsureLineMatch(filePath, matcher, line string) error
- func (linux *Linux) FileExists(filePath string) bool
- func (linux *Linux) FileGet(filePath string) (string, error)
- func (linux *Linux) FileModeEnsure(filePath string, mode permbits.PermissionBits) error
- func (linux *Linux) FileModeGet(filePath string) (permbits.PermissionBits, error)
- func (linux *Linux) FileModeSet(filePath string, mode permbits.PermissionBits) error
- func (linux *Linux) FileSet(filePath, content string) error
- func (linux *Linux) GroupExists(groupName string) bool
- func (linux *Linux) TemplateCommand(template string, args map[string]interface{}) *exec.Cmd
- func (linux *Linux) UserCreate(new linux.User) error
- func (linux *Linux) UserExists(userName string) bool
Constants ¶
This section is empty.
Variables ¶
var ( // ErrorGitHubConnectionFailed - returned when there was a connection error with github.com ErrorGitHubConnectionFailed = errors.New("Connection to github.com failed") // ErrorGitHubAccessDenied - returned when there was access denied to github.com resource ErrorGitHubAccessDenied = errors.New("Access denied") // ErrorGitHubNotFound - returned when github.com resource not found ErrorGitHubNotFound = errors.New("Not found") )
Functions ¶
This section is empty.
Types ¶
type GithubClient ¶
type GithubClient struct {
// contains filtered or unexported fields
}
GithubClient - client for operate with Github API
func NewGithubClient ¶
func NewGithubClient(token, owner string, githubURL string) *GithubClient
NewGithubClient - constructor of GithubClient structure
func (*GithubClient) GetKeys ¶
func (c *GithubClient) GetKeys(userName string) (keys []*github.Key, err error)
GetKeys - return array of user's {userName} public keys
func (*GithubClient) GetOrg ¶
func (c *GithubClient) GetOrg() (org string)
func (*GithubClient) GetTeamMembers ¶
func (c *GithubClient) GetTeamMembers(org string, team *github.Team) (users []*github.User, err error)
GetTeamMembers - return array of user's that are {team} members
func (*GithubClient) IsTeamMember ¶
IsTeamMember - check if {user} is a membmer of {team}
type Linux ¶
type Linux struct {
// contains filtered or unexported fields
}
Linux - linux os with root dir
func NewLinux ¶
NewLinux - creates object allow interact with operating system
rootDir - Path to directory contains linux root.
Returns: OS object
func (*Linux) Command ¶
Command returns the Cmd struct to execute the named program with the given arguments in context of OS
It sets only the Path and Args in the returned structure.
If name contains no path separators, Command uses LookPath to resolve the path to a complete name if possible. Otherwise it uses name directly.
The returned Cmd's Args field is constructed from the command name followed by the elements of arg, so arg should not include the command name itself. For example, Command("echo", "hello")
func (*Linux) FileCreate ¶
FileCreate - creates new file
func (*Linux) FileDelete ¶
FileDelete - removes file
func (*Linux) FileEnsure ¶
FileEnsure - If file not exists create it file, update content in that file if it differs.
func (*Linux) FileEnsureLine ¶
FileEnsureLine - add line to file if it is not present in file content
func (*Linux) FileEnsureLineMatch ¶
FileEnsureLineMatch - add line to file if there is no line that match regexp or that line differs
func (*Linux) FileExists ¶
FileExists - check if file exists
func (*Linux) FileModeEnsure ¶
func (linux *Linux) FileModeEnsure(filePath string, mode permbits.PermissionBits) error
FileModeEnsure - set file permission mode if differs
func (*Linux) FileModeGet ¶
func (linux *Linux) FileModeGet(filePath string) (permbits.PermissionBits, error)
FileModeGet - get file permission mode
func (*Linux) FileModeSet ¶
func (linux *Linux) FileModeSet(filePath string, mode permbits.PermissionBits) error
FileModeSet - set file permission mode
func (*Linux) GroupExists ¶
GroupExists - check if group {groupName} exists
func (*Linux) TemplateCommand ¶
TemplateCommand - creates command based on template and args with placeholders.
func (*Linux) UserCreate ¶
UserCreate - create user {new}
func (*Linux) UserExists ¶
UserExists - check if user {userName} exists