helper

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WebSocketUpgrade = websocket.Upgrader{
	ReadBufferSize:  1024,
	WriteBufferSize: 1024,
}

WebSocketUpgrade buffer size.

Functions

func Add

func Add(b, a interface{}) (interface{}, error)

Add sums up the numbers in the pattern.

func CopyDirContent

func CopyDirContent(src string, dst string) error

CopyDirContent copies dir content.

func CopyFile

func CopyFile(src, dst string) error

CopyFile creates file copy.

func CreateNewDir

func CreateNewDir(path string) error

CreateNewDir creates new folder in current file system.

func Exec

func Exec(command string)

Exec execute the shell command.

func GenerateUUID

func GenerateUUID() string

GenerateUUID returns new UUID in v4 format.

func GetCurrentPath

func GetCurrentPath() string

GetCurrentPath returns current location path.

func IsDirExists

func IsDirExists(dirPath string) bool

IsDirExists returns dir exists flag.

func IsFileExists

func IsFileExists(filename string) bool

IsFileExists returns is file exists flag.

func Move

func Move(oldLocation string, newLocation string) error

Move moves file to new location.

func OpenBrowser

func OpenBrowser(url string)

OpenBrowser opens web browser in different platforms.

func RemoveDir

func RemoveDir(path string) error

RemoveDir removes folder from current file system.

func WriteFile

func WriteFile(filename string, content string)

WriteFile writes file data.

func WsHandler

func WsHandler(w http.ResponseWriter, r *http.Request, body interface{}) (*websocket.Conn, error)

WsHandler handles stream messages.

Types

type MarshalFunc

type MarshalFunc func(v interface{}) ([]byte, error)

MarshalFunc returns byte data.

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

Repo contain repository object.

func (*Repo) GetLog

func (r *Repo) GetLog(n int) ([]*gogit.Commit, error)

GetLog returns log.

func (*Repo) IsDirty

func (r *Repo) IsDirty() bool

IsDirty returns diff "dirty" flag.

func (*Repo) SaveCommit

func (r *Repo) SaveCommit(commit *gogit.Commit) (string, error)

SaveCommit save commit meta.

func (*Repo) SaveCommitIfModified

func (r *Repo) SaveCommitIfModified(commit *gogit.Commit) (string, error)

SaveCommitIfModified returns the ref of change and error.

type UnmarshalFunc

type UnmarshalFunc func(data []byte, v interface{}) error

UnmarshalFunc gets byte data.

Jump to

Keyboard shortcuts

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