service

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base16Encrypt added in v0.5.3

func Base16Encrypt(key string, data string) string

Base16Encrypt HMAC encrypt base16

func Base64Encrypt added in v0.5.3

func Base64Encrypt(key string, data string) string

Base64Encrypt HMAC encrypt base64

func RemoveTrailingSlash added in v0.5.3

func RemoveTrailingSlash(url string) string

RemoveTrailingSlash removes any trailing slash

Types

type Correlation

type Correlation struct {
}

Correlation struct

func NewCorrelation

func NewCorrelation() *Correlation

NewCorrelation creates a new instance

func (*Correlation) UUIDv4

func (c *Correlation) UUIDv4() string

UUIDv4 create a UUID version 4

type FileSystem

type FileSystem struct {
}

FileSystem struct

func NewFileSystem

func NewFileSystem() *FileSystem

NewFileSystem creates a new instance

func (*FileSystem) DeleteDir

func (fs *FileSystem) DeleteDir(dir string) error

DeleteDir deletes a dir

func (*FileSystem) DirExists

func (fs *FileSystem) DirExists(path string) bool

DirExists reports whether the dir exists

func (*FileSystem) EnsureDir

func (fs *FileSystem) EnsureDir(dirName string, mode int) error

EnsureDir ensures that directory exists

func (*FileSystem) FileExists

func (fs *FileSystem) FileExists(path string) bool

FileExists reports whether the named file exists

type HttpClient added in v0.5.3

type HttpClient struct {
}

HttpClient struct

func NewHTTPClient added in v0.5.3

func NewHTTPClient() *HttpClient

NewHTTPClient creates an instance of http client

func (*HttpClient) BuildData added in v0.5.3

func (h *HttpClient) BuildData(parameters map[string]string) string

BuildData build body data

func (*HttpClient) BuildParameters added in v0.5.3

func (h *HttpClient) BuildParameters(endpoint string, parameters map[string]string) (string, error)

BuildParameters add parameters to URL

func (*HttpClient) Delete added in v0.5.3

func (h *HttpClient) Delete(ctx context.Context, endpoint string, parameters map[string]string, headers map[string]string) (*http.Response, error)

Delete http call

func (*HttpClient) Get added in v0.5.3

func (h *HttpClient) Get(ctx context.Context, endpoint string, parameters map[string]string, headers map[string]string) (*http.Response, error)

Get http call

func (*HttpClient) GetStatusCode added in v0.5.3

func (h *HttpClient) GetStatusCode(response *http.Response) int

GetStatusCode response status code

func (*HttpClient) Post added in v0.5.3

func (h *HttpClient) Post(ctx context.Context, endpoint string, data string, parameters map[string]string, headers map[string]string) (*http.Response, error)

Post http call

func (*HttpClient) Put added in v0.5.3

func (h *HttpClient) Put(ctx context.Context, endpoint string, data string, parameters map[string]string, headers map[string]string) (*http.Response, error)

Put http call

func (*HttpClient) ToString added in v0.5.3

func (h *HttpClient) ToString(response *http.Response) (string, error)

ToString response body to string

Jump to

Keyboard shortcuts

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