Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Request ¶
func Request(p *Settings, b []byte, apiPath string, authKey string, authValue string) (map[string]interface{}, error)
Request executes the actual HTTP call
func StringToDateTimeHook ¶
StringToDateTimeHook is used with mapstructure package to correctly unmarshal time fields https://github.com/mitchellh/mapstructure/issues/41
Types ¶
type CustomError ¶
type CustomError struct { ErrCode ErrorCode // local ErrorCode for the error ErrMsg string // local text error message }
CustomError contains data about an local error during HTTP operation
func NewCustomError ¶
func NewCustomError(msg string, errCode ErrorCode) *CustomError
NewCustomError returns a new CustomError with a message and an error code
func (*CustomError) Error ¶
func (p *CustomError) Error() string
type CustomRemoteError ¶
type CustomRemoteError struct { ErrCode ErrorCode // local ErrorCode for the error RemoteStatus string // String HTTP code RemoteErrCode int // Numerical PlayFab error code RemoteErrCodeText string // Text Playfab error code RemoteErrMsg string // Description for the PlayFab errorCode RemoteErrDetails map[string][]string }
CustomRemoteError contains data about an remote error from the HTTP operation
func NewCustomRemoteError ¶
func NewCustomRemoteError(res *playFabResponse, errCode ErrorCode) *CustomRemoteError
NewCustomRemoteError returns a new CustomError with a message and an error code
func (*CustomRemoteError) Error ¶
func (p *CustomRemoteError) Error() string
type ErrorCode ¶
type ErrorCode int
ErrorCode is a custom error code
const ( // ErrorUnmarshal is an error during response unmarshaling ErrorUnmarshal ErrorCode = iota // ErrorGZIP is an error during GZIPing ErrorGZIP // ErrorCreateRequest is an error during request creation ErrorCreateRequest // ErrorDoRequest is an error during request execution ErrorDoRequest // ErrorMarshal is an error during POST data marshaling ErrorMarshal // ErrorDecoding is an error that occurs during map[string]interface{} -> struct creation ErrorDecoding // ErrorGeneric represents a generic error ErrorGeneric // ErrorRemote represents remote error ErrorRemote )
type Settings ¶
type Settings struct { VersionString string RequestGetParams map[string]string ProductionEnvironmentURL string EnableCompression bool VerticalName string TitleId string DisableSsl bool APIPath string AdvertisingIdType AdType AdvertisingIdValue string DisableAdvertising bool }
Settings includes various conf options for PlayFab HTTP call
func NewSettingsWithDefaultOptions ¶
NewSettingsWithDefaultOptions returns a pointer to a Settings struct that carries default values Requires a valid titleId