api

package
v0.0.0-...-06a89c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) *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) GetTeam

func (c *GithubClient) GetTeam(name string, id int) (team *github.Team, err error)

GetTeam - return team structure based on name or id

func (*GithubClient) GetTeamMembers

func (c *GithubClient) GetTeamMembers(team *github.Team) (users []*github.User, err error)

GetTeamMembers - return array of user's that are {team} members

func (*GithubClient) IsTeamMember

func (c *GithubClient) IsTeamMember(user string, team *github.Team) (bool, error)

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

func NewLinux(rootDir string) Linux

NewLinux - creates object allow interact with operating system

rootDir - Path to directory contains linux root.

Returns: OS object

func (*Linux) Command

func (linux *Linux) Command(name string, params ...string) *exec.Cmd

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

func (linux *Linux) FileCreate(filePath string) error

FileCreate - creates new file

func (*Linux) FileDelete

func (linux *Linux) FileDelete(filePath string) error

FileDelete - removes file

func (*Linux) FileEnsure

func (linux *Linux) FileEnsure(filePath, content string) error

FileEnsure - If file not exists create it file, update content in that file if it differs.

func (*Linux) FileEnsureLine

func (linux *Linux) FileEnsureLine(filePath string, line string) error

FileEnsureLine - add line to file if it is not present in file content

func (*Linux) FileEnsureLineMatch

func (linux *Linux) FileEnsureLineMatch(filePath, matcher, line string) error

FileEnsureLineMatch - add line to file if there is no line that match regexp or that line differs

func (*Linux) FileExists

func (linux *Linux) FileExists(filePath string) bool

FileExists - check if file exists

func (*Linux) FileGet

func (linux *Linux) FileGet(filePath string) (string, error)

FileGet - return file content

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) FileSet

func (linux *Linux) FileSet(filePath, content string) error

FileSet - set file content

func (*Linux) GroupExists

func (linux *Linux) GroupExists(groupName string) bool

GroupExists - check if group {groupName} exists

func (*Linux) TemplateCommand

func (linux *Linux) TemplateCommand(template string, args map[string]interface{}) *exec.Cmd

TemplateCommand - creates command based on template and args with placeholders.

func (*Linux) UserCreate

func (linux *Linux) UserCreate(new linux.User) error

UserCreate - create user {new}

func (*Linux) UserExists

func (linux *Linux) UserExists(userName string) bool

UserExists - check if user {userName} exists

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL