axapi

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallMultipartAPI added in v1.1.0

func CallMultipartAPI(method string, host string, token map[string]string, path string, rpns map[string]string, rfcs map[string][]byte, logger *ThunderLog) (resp *http.Response, err error)

func GenRequestHeader

func GenRequestHeader(authToken string) map[string]string

func GenRequestHeaderNoToken

func GenRequestHeaderNoToken() map[string]string

func GenUrlForDownload

func GenUrlForDownload(protocol string, host string, path string, username string) string

func IsAbsolutePath

func IsAbsolutePath(val interface{}, key string) (warns []string, errs []error)

func IsIpv4NetmaskBrief

func IsIpv4NetmaskBrief(val interface{}, key string) (warns []string, errs []error)

func IsIpv6AddressPlen

func IsIpv6AddressPlen(val interface{}, key string) (warns []string, errs []error)

func NormalizeMultipartObject added in v1.1.0

func NormalizeMultipartObject(method, path, file string, fContent []byte, obj interface{}, token map[string]string, host string, logger *ThunderLog) (*http.Response, error)

func Request

func Request(method string, host string, endpoint string, instId string, reqBytes []byte, headers map[string]string, logger *ThunderLog) (*http.Response, []byte, error)

func SendDelete

func SendDelete(host string, endpoint string, instId string, reqBytes []byte, headers map[string]string, logger *ThunderLog) (*http.Response, []byte, error)

func SendGet

func SendGet(host string, endpoint string, instId string, reqBytes []byte, headers map[string]string, logger *ThunderLog) (*http.Response, []byte, error)

func SendPost

func SendPost(host string, endpoint string, reqBytes []byte, headers map[string]string, logger *ThunderLog) (*http.Response, []byte, error)

func SendPut

func SendPut(host string, endpoint string, instId string, reqBytes []byte, headers map[string]string, logger *ThunderLog) (*http.Response, []byte, error)

func SerializeToJson

func SerializeToJson(a interface{}) ([]byte, error)

Types

type AxApiResponse

type AxApiResponse struct {
	Inst struct {
		Status string `json:"status"`
		Err    struct {
			Code int    `json:"code"`
			From string `json:"from"`
			Msg  string `json:"msg"`
		} `json:"err"`
	} `json:"response"`
}

type ThunderLog

type ThunderLog struct {
	*log.Logger
	// contains filtered or unexported fields
}

func CreateLogger

func CreateLogger(partition_name string) *ThunderLog

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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