Documentation
¶
Index ¶
- func VerifyUser(username, password, clientCode string, client *http.Client) (string, error)
- func VerifyUserV2(ctx context.Context, filters map[string]string, clientCode string, ...) (string, error)
- type Client
- type HttpClient
- type IdentityToken
- type JwtToken
- type JwtTokenResponse
- type PartnerClient
- type PartnerTokenProvider
- type Provider
- type SessionInfo
- type SessionKeyInfo
- type SessionKeyInfoResponse
- type SessionKeyUser
- func GetSessionKeyUser(sessionKey string, clientCode string, client HttpClient) (*SessionKeyUser, error)
- func SwitchUser(ctx context.Context, sessionKey, pin, clientCode string, ...) (*SessionKeyUser, error)
- func VerifyUserFull(ctx context.Context, username, password, clientCode string, ...) (*SessionKeyUser, error)
- type SessionKeyUserResponse
- type SwitchUserResponse
- type VerifyUserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyUser ¶
VerifyUser will give you session key
Types ¶
type Client ¶
func (*Client) GetIdentityToken ¶
func (cli *Client) GetIdentityToken(ctx context.Context) (*IdentityToken, error)
GetIdentityToken ...
func (*Client) GetJWTToken ¶
GetJWTToken executes the getJWTToken query (https://learn-api.erply.com/requests/getjwttoken).
func (*Client) VerifyIdentityToken ¶
VerifyIdentityToken ...
type IdentityToken ¶
type IdentityToken struct {
Jwt string `json:"identityToken"`
}
type JwtTokenResponse ¶
type PartnerClient ¶
func NewPartnerClient ¶
func NewPartnerClient(client *common.Client) *PartnerClient
func (*PartnerClient) GetJWTToken ¶
func (cli *PartnerClient) GetJWTToken(ctx context.Context) (*JwtToken, error)
only for partnerClient
type PartnerTokenProvider ¶
interface only for partner tokens
type SessionInfo ¶
type SessionInfo struct {
SessionKey string `json:"sessionKey"`
}
type SessionKeyInfo ¶ added in v1.7.1
type SessionKeyInfo struct {
CreationUnixTime string `json:"creationUnixTime"`
ExpireUnixTime string `json:"expireUnixTime"`
}
func GetSessionKeyInfo ¶ added in v1.7.1
func GetSessionKeyInfo(sessionKey string, clientCode string, client HttpClient) (*SessionKeyInfo, error)
GetSessionKeyInfo returns session key expiration info
type SessionKeyInfoResponse ¶ added in v1.7.1
type SessionKeyInfoResponse struct {
Status common2.Status `json:"status"`
Records []SessionKeyInfo `json:"records"`
}
type SessionKeyUser ¶
type SessionKeyUser struct {
UserID string `json:"userID"`
UserName string `json:"userName"`
EmployeeName string `json:"employeeName"`
EmployeeID string `json:"employeeID"`
GroupID string `json:"groupID"`
GroupName string `json:"groupName"`
IPAddress string `json:"ipAddress"`
SessionKey string `json:"sessionKey"`
SessionLength int `json:"sessionLength"`
LoginUrl string `json:"loginUrl"`
BerlinPOSVersion string `json:"berlinPOSVersion"`
BerlinPOSAssetsURL string `json:"berlinPOSAssetsURL"`
EpsiURL string `json:"epsiURL"`
IdentityToken string `json:"identityToken"`
Token string `json:"token"`
}
func GetSessionKeyUser ¶
func GetSessionKeyUser(sessionKey string, clientCode string, client HttpClient) (*SessionKeyUser, error)
GetSessionKeyUser returns user information for the used session key
func SwitchUser ¶ added in v1.9.1
func SwitchUser(ctx context.Context, sessionKey, pin, clientCode string, inputParams map[string]string, cli *http.Client) (*SessionKeyUser, error)
SwitchUser executes the Erply API SwitchUser call and returns an object containing most of the resulting data. If it is necessary to specify the length of the created session or pass some other additional parameters to the underlying Erply API call, this can be done using the inputParams map.
func VerifyUserFull ¶ added in v1.9.1
func VerifyUserFull(ctx context.Context, username, password, clientCode string, inputParams map[string]string, cli *http.Client) (*SessionKeyUser, error)
VerifyUserFull executes the Erply API VerifyUser call and returns an object containing most of the resulting data. If it is necessary to specify the length of the created session or pass some other additional parameters to the underlying Erply API call, this can be done using the inputParams map.
type SessionKeyUserResponse ¶
type SessionKeyUserResponse struct {
Records []SessionKeyUser `json:"records"`
}
type SwitchUserResponse ¶ added in v1.9.1
type SwitchUserResponse struct {
Status common2.Status `json:"status"`
Records []SessionKeyUser `json:"records"`
}
type VerifyUserResponse ¶
type VerifyUserResponse struct {
Status common2.Status `json:"status"`
Records []SessionKeyUser `json:"records"`
}