Documentation
¶
Index ¶
- func BuildHttpBody(b interface{}) (*bytes.Buffer, error)
- func Copy(src, dest string) error
- func EnsureDirectoryExists(path string) error
- func GenRandInt(min, max int) int
- func GenerateAK(prefix string) (string, error)
- func GenerateSK() (string, error)
- func InSlice(s string, ss []string) bool
- func IsDirectoryExists(path string) bool
- func IsFileExists(path string) bool
- func KeyFunc(key interface{}) (int64, int64, error)
- func Move(src, dest string) error
- func NewHttpClient(timeout time.Duration, url string) *httpClient
- func ReadFromFile(fileName string) ([]byte, error)
- func RemoveFile(filePath string)
- func RunCmd(exec exec.Interface, cmd []string) ([]byte, error)
- func ToRegexp(pattern string) string
- func TrimAndFilter(input []string) []string
- func WriteIntoFile(content string, fileName string) error
- type Auth
- type Git
- type HttpClientV2
- func (c *HttpClientV2) Do(val interface{}) *HttpError
- func (c *HttpClientV2) Method(method string) *HttpClientV2
- func (c *HttpClientV2) WithAuth(username, password string) *HttpClientV2
- func (c *HttpClientV2) WithBody(body io.Reader) *HttpClientV2
- func (c *HttpClientV2) WithFile(filename string) *HttpClientV2
- func (c *HttpClientV2) WithHeader(headers map[string]string) *HttpClientV2
- func (c *HttpClientV2) WithTimeout(t time.Duration) *HttpClientV2
- type HttpError
- type HttpInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildHttpBody ¶
func EnsureDirectoryExists ¶
func GenRandInt ¶
func IsDirectoryExists ¶
func IsFileExists ¶
func NewHttpClient ¶
func ReadFromFile ¶
func RemoveFile ¶
func RemoveFile(filePath string)
func TrimAndFilter ¶
func WriteIntoFile ¶
Types ¶
type Git ¶
type Git struct {
RepoDir string
Branch string
Title string
// contains filtered or unexported fields
}
Git 封装 git 命令行,以避免依赖,golang 的 git 库需要按照 c 库
func (*Git) CurrentBranch ¶
func (*Git) LocalBranches ¶
type HttpClientV2 ¶
type HttpClientV2 struct {
URL string
// contains filtered or unexported fields
}
func (*HttpClientV2) Do ¶
func (c *HttpClientV2) Do(val interface{}) *HttpError
func (*HttpClientV2) Method ¶
func (c *HttpClientV2) Method(method string) *HttpClientV2
func (*HttpClientV2) WithAuth ¶
func (c *HttpClientV2) WithAuth(username, password string) *HttpClientV2
func (*HttpClientV2) WithBody ¶
func (c *HttpClientV2) WithBody(body io.Reader) *HttpClientV2
func (*HttpClientV2) WithFile ¶
func (c *HttpClientV2) WithFile(filename string) *HttpClientV2
func (*HttpClientV2) WithHeader ¶
func (c *HttpClientV2) WithHeader(headers map[string]string) *HttpClientV2
func (*HttpClientV2) WithTimeout ¶
func (c *HttpClientV2) WithTimeout(t time.Duration) *HttpClientV2
Click to show internal directories.
Click to hide internal directories.