Documentation ¶
Overview ¶
Package apiclient contains all you need to communicate with the insanely fast HEXONET backend API.
Index ¶
- Constants
- type APIClient
- func (cl *APIClient) DisableDebugMode() *APIClient
- func (cl *APIClient) EnableDebugMode() *APIClient
- func (cl *APIClient) GetPOSTData(cmd map[string]string, secured ...bool) string
- func (cl *APIClient) GetProxy() (string, error)
- func (cl *APIClient) GetReferer() (string, error)
- func (cl *APIClient) GetSession() (string, error)
- func (cl *APIClient) GetURL() string
- func (cl *APIClient) GetUserAgent() string
- func (cl *APIClient) GetVersion() string
- func (cl *APIClient) Login(params ...string) *R.Response
- func (cl *APIClient) LoginExtended(params ...interface{}) *R.Response
- func (cl *APIClient) Logout() *R.Response
- func (cl *APIClient) Request(cmd map[string]interface{}) *R.Response
- func (cl *APIClient) RequestAllResponsePages(cmd map[string]string) []R.Response
- func (cl *APIClient) RequestNextResponsePage(rr *R.Response) (*R.Response, error)
- func (cl *APIClient) ResetUserView() *APIClient
- func (cl *APIClient) ReuseSession(sessionobj map[string]interface{}) *APIClient
- func (cl *APIClient) SaveSession(sessionobj map[string]interface{}) *APIClient
- func (cl *APIClient) SetCredentials(uid string, pw string) *APIClient
- func (cl *APIClient) SetCustomLogger(logger LG.ILogger) *APIClient
- func (cl *APIClient) SetDefaultLogger() *APIClient
- func (cl *APIClient) SetOTP(value string) *APIClient
- func (cl *APIClient) SetProxy(proxy string) *APIClient
- func (cl *APIClient) SetReferer(referer string) *APIClient
- func (cl *APIClient) SetRemoteIPAddress(value string) *APIClient
- func (cl *APIClient) SetRoleCredentials(uid string, role string, pw string) *APIClient
- func (cl *APIClient) SetSession(value string) *APIClient
- func (cl *APIClient) SetURL(value string) *APIClient
- func (cl *APIClient) SetUserAgent(str string, rv string, modules ...[]string) *APIClient
- func (cl *APIClient) SetUserView(uid string) *APIClient
- func (cl *APIClient) UseDefaultConnectionSetup() *APIClient
- func (cl *APIClient) UseHighPerformanceConnectionSetup() *APIClient
- func (cl *APIClient) UseLIVESystem() *APIClient
- func (cl *APIClient) UseOTESystem() *APIClient
Constants ¶
const ISPAPI_CONNECTION_URL_LIVE = "https://api.ispapi.net/api/call.cgi" //nolint
ISPAPI_CONNECTION_URL_LIVE represents the url used for the default connection setup
const ISPAPI_CONNECTION_URL_OTE = "https://api-ote.ispapi.net/api/call.cgi" //nolint
ISPAPI_CONNECTION_URL_OTE represents the url used for the OT&E (demo system) connection setup
const ISPAPI_CONNECTION_URL_PROXY = "http://127.0.0.1/api/call.cgi" //nolint
ISPAPI_CONNECTION_URL_PROXY represents the url used for the high performance connection setup
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient is the entry point class for communicating with the insanely fast HEXONET backend api. It allows two ways of communication: * session based communication * sessionless communication
A session based communication makes sense in case you use it to build your own frontend on top. It allows also to use 2FA (2 Factor Auth) by providing "otp" in the config parameter of the login method. A sessionless communication makes sense in case you do not need to care about the above and you have just to request some commands.
Possible commands can be found at https://github.com/hexonet/hexonet-api-documentation/tree/master/API
func NewAPIClient ¶
func NewAPIClient() *APIClient
NewAPIClient represents the constructor for struct APIClient.
func (*APIClient) DisableDebugMode ¶
DisableDebugMode method to disable Debug Output to logger
func (*APIClient) EnableDebugMode ¶
EnableDebugMode method to enable Debug Output to logger
func (*APIClient) GetPOSTData ¶
GetPOSTData method to Serialize given command for POST request including connection configuration data
func (*APIClient) GetProxy ¶
GetProxy method to get the configured proxy to use for API communication
func (*APIClient) GetReferer ¶
GetReferer method to get configured HTTP Header `Referer` value
func (*APIClient) GetSession ¶
GetSession method to get the API Session that is currently set
func (*APIClient) GetUserAgent ¶
GetUserAgent method to return the user agent string
func (*APIClient) GetVersion ¶
GetVersion method to get current module version
func (*APIClient) Login ¶
Login method to perform API login to start session-based communication 1st parameter: one time password
func (*APIClient) LoginExtended ¶
LoginExtended method to perform API login to start session-based communication. 1st parameter: map of additional command parameters 2nd parameter: one time password
func (*APIClient) RequestAllResponsePages ¶
RequestAllResponsePages method to request all pages/entries for the given query command Use this method with caution as it requests all list data until done.
func (*APIClient) RequestNextResponsePage ¶
RequestNextResponsePage method to request the next page of list entries for the current list query Useful for lists
func (*APIClient) ResetUserView ¶
ResetUserView method to reset data view back from subuser to user
func (*APIClient) ReuseSession ¶
ReuseSession method to reuse given configuration out of a user session to rebuild and reuse connection settings
func (*APIClient) SaveSession ¶
SaveSession method to apply data to a session for later reuse Please save/update that map into user session
func (*APIClient) SetCredentials ¶
SetCredentials method to set Credentials to be used for API communication
func (*APIClient) SetCustomLogger ¶
SetCustomLogger method to use a custom mechanism for debug mode outputs/logging
func (*APIClient) SetDefaultLogger ¶
SetDefaultLogger method to use the default mechanism for debug mode outputs
func (*APIClient) SetReferer ¶
SetReferer method to set a value for HTTP Header `Referer` to use for API communication
func (*APIClient) SetRemoteIPAddress ¶
SetRemoteIPAddress method to set an Remote IP Address to be used for API communication
func (*APIClient) SetRoleCredentials ¶
SetRoleCredentials method to set Role User Credentials to be used for API communication
func (*APIClient) SetSession ¶
SetSession method to set an API session id to be used for API communication
func (*APIClient) SetURL ¶
SetURL method to set another connection url to be used for API communication
func (*APIClient) SetUserAgent ¶
SetUserAgent method to customize user-agent header (useful for tools that use our SDK)
func (*APIClient) SetUserView ¶
SetUserView method to set a data view to a given subuser
func (*APIClient) UseDefaultConnectionSetup ¶
UseDefaultConnectionSetup to activate default conneciton setup (the default anyways)
func (*APIClient) UseHighPerformanceConnectionSetup ¶
UseHighPerformanceConnectionSetup to activate high performance conneciton setup
func (*APIClient) UseLIVESystem ¶
UseLIVESystem method to set LIVE System for API communication Usage of LIVE System is active by default.
func (*APIClient) UseOTESystem ¶
UseOTESystem method to set OT&E System for API communication