Documentation
¶
Index ¶
- Constants
- func Aes256CBCEncode(plaintext string, encryptKey []byte, iv []byte) (error, []byte)
- func Ase256CBCDecode(cipherText string, encKey []byte, iv []byte) (error, []byte)
- func DecryptData(data string, encryptKey string) (error, []byte)
- func GetFunctionName(i interface{}) string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5Trimming(encrypt []byte) []byte
- func SliceContains[T comparable](array []T, target T) bool
- type ApiHelper
- func (h *ApiHelper) Get() ([]byte, error)
- func (h *ApiHelper) Post() ([]byte, error)
- func (h *ApiHelper) Send() ([]byte, error)
- func (h *ApiHelper) SetBody(body []byte) *ApiHelper
- func (h *ApiHelper) SetContentType(contentType ContentType) *ApiHelper
- func (h *ApiHelper) SetQuery(values map[string]string) *ApiHelper
- func (h *ApiHelper) SetUploadFile(filePath string) *ApiHelper
- func (h *ApiHelper) String() string
- type ContentType
- type HttpMethod
Constants ¶
View Source
const ( MethodGet HttpMethod = "GET" MethodPost HttpMethod = "POST" ContentJSON ContentType = "application/json" ContentFormUrlEncode ContentType = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
func Aes256CBCEncode ¶ added in v0.0.8
func Ase256CBCDecode ¶ added in v0.0.8
func GetFunctionName ¶
func GetFunctionName(i interface{}) string
func PKCS5Padding ¶
func PKCS5Trimming ¶
func SliceContains ¶
func SliceContains[T comparable](array []T, target T) bool
Types ¶
type ApiHelper ¶
type ApiHelper struct {
Token string
Type string
Language string
BaseUrl string
QueryParam string
Path string
Body []byte
ContentType ContentType
Method HttpMethod
File string
FileFieldName string
ContentTypeStr string
BodyBuffer *bytes.Buffer
// contains filtered or unexported fields
}
func NewApiHelper ¶
func (*ApiHelper) SetContentType ¶
func (h *ApiHelper) SetContentType(contentType ContentType) *ApiHelper
func (*ApiHelper) SetUploadFile ¶ added in v0.0.3
type ContentType ¶
type ContentType string
type HttpMethod ¶
type HttpMethod string
Click to show internal directories.
Click to hide internal directories.