Documentation ¶
Index ¶
- Variables
- func Context(ctx context.Context, mandatoryRequest Request) context.Context
- type Authorization
- type Builder
- func (m Builder) Build() Request
- func (m Builder) WithApiKey(apiKey string) Builder
- func (m Builder) WithApplication(deviceID, appsVersion string) Builder
- func (m Builder) WithAuthorization(authorization string) Builder
- func (m Builder) WithDeviceType(deviceType string) Builder
- func (m Builder) WithIpAddresses(ipAddress []string) Builder
- func (m Builder) WithLanguage(language string) Builder
- func (m Builder) WithPhone(ID uint64, phone string) Builder
- func (m Builder) WithServiceSecret(ID, secret string) Builder
- func (m Builder) WithTraceID(traceID string) Builder
- func (m Builder) WithUser(ID uint64, email string) Builder
- func (m Builder) WithUserAgent(userAgent string) Builder
- func (m Builder) WithUserPhone(ID uint64, email string, phone string) Builder
- type Device
- type DeviceInfo
- type DeviceType
- type OS
- type Request
- func (m Request) Authorization() Authorization
- func (m Request) Device() Device
- func (m Request) DeviceType() DeviceType
- func (m Request) IpAddresses() []string
- func (m Request) IsMobileApp() bool
- func (m Request) IsUserLogin() bool
- func (m Request) IsWebApp() bool
- func (m Request) Language() string
- func (m Request) OS() OS
- func (m Request) TraceID() string
- func (m Request) User() User
- func (m Request) UserAgent() UserAgent
- func (m Request) Valid() bool
- type User
- type UserAgent
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidDeviceType = fmt.Errorf("invalid device")
ErrInvalidDeviceType error invalid device type.
Functions ¶
Types ¶
type Authorization ¶
type Authorization struct {
// contains filtered or unexported fields
}
Authorization object of mandatory request.
func (Authorization) ApiKey ¶
func (a Authorization) ApiKey() string
ApiKey getter function to get mandatory Authorization ApiKey.
func (Authorization) Authorization ¶
func (a Authorization) Authorization() string
Authorization getter function to get mandatory Authorization.
func (Authorization) ServiceID ¶
func (a Authorization) ServiceID() string
ServiceID getter function to get mandatory Authorization ServiceID.
func (Authorization) ServiceSecret ¶
func (a Authorization) ServiceSecret() string
ServiceSecret getter function to get mandatory Authorization ServiceSecret.
func (Authorization) Token ¶
func (a Authorization) Token() string
Token getter function to get mandatory Authorization Token.
type Builder ¶
type Builder struct { Request // contains filtered or unexported fields }
Builder builder object for Request.
func NewMandatoryRequestBuilder ¶
NewMandatoryRequestBuilder initialize builder object for Request.
func (Builder) WithApiKey ¶
WithApiKey getter function to set ApiKey.
func (Builder) WithApplication ¶
WithApplication getter function to set Application.
func (Builder) WithAuthorization ¶
WithAuthorization getter function to set Authorization.
func (Builder) WithDeviceType ¶
WithDeviceType getter function to set DeviceType.
func (Builder) WithIpAddresses ¶
WithIpAddresses getter function to set IpAddresses.
func (Builder) WithLanguage ¶
WithLanguage getter function to set Language.
func (Builder) WithServiceSecret ¶
WithServiceSecret getter function to set ServiceSecret.
func (Builder) WithTraceID ¶
WithTraceID getter function to set TraceID.
func (Builder) WithUserAgent ¶
WithUserAgent getter function to set UserAgent.
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device object of mandatory request.
func (Device) AppVersion ¶
AppVersion getter function to get mandatory Device AppVersion.
type DeviceInfo ¶
type DeviceInfo struct {
// contains filtered or unexported fields
}
DeviceInfo object device.
type DeviceType ¶
type DeviceType int
DeviceType enum of device type.
const ( Android DeviceType = iota + 1 Ios Web MobileWeb )
func DeviceFromString ¶
func DeviceFromString(str string) (DeviceType, error)
DeviceFromString function to get DeviceType from string.
func DeviceFromStringCode ¶
func DeviceFromStringCode(str string) (DeviceType, error)
DeviceFromStringCode function to get DeviceType from string code.
func (DeviceType) MarshalJSON ¶
func (s DeviceType) MarshalJSON() ([]byte, error)
MarshalJSON implements the marshaller interface.
func (*DeviceType) UnmarshalJSON ¶
func (s *DeviceType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the un marshaller interface.
func (DeviceType) Valid ¶ added in v1.0.1
func (s DeviceType) Valid() bool
Valid getter function to get code.
type OS ¶
type OS struct {
// contains filtered or unexported fields
}
OS object of mandatory OS.
func (OS) PatchMinor ¶
PatchMinor getter function to get OS patch minor version.
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request object of mandatory request.
func FromContext ¶
FromContext function to get mandatory from context.
func (Request) Authorization ¶
func (m Request) Authorization() Authorization
Authorization getter function to get authorization.
func (Request) DeviceType ¶
func (m Request) DeviceType() DeviceType
DeviceType getter function to get device type.
func (Request) IpAddresses ¶
IpAddresses getter function to get ip addresses.
func (Request) IsMobileApp ¶
IsMobileApp getter function to check Request object is MobileApp.
func (Request) IsUserLogin ¶
IsUserLogin getter function to check Request object is Login User.
type User ¶
type User struct {
// contains filtered or unexported fields
}
User object of mandatory User.
type UserAgent ¶
type UserAgent struct {
// contains filtered or unexported fields
}
UserAgent object of mandatory UserAgent.