Versions in this module Expand all Collapse all v0 v0.1.2 Jan 15, 2025 Changes in this version type Request + Header http.Header v0.1.1 Dec 31, 2024 v0.1.0 Dec 31, 2024 Changes in this version + const HostJPushAdminV1 + const HostJPushDeviceV3 + const HostJPushPushV3 + const HostJPushReportV3 + var DefaultLogger jiguang.Logger = jiguang.NewStdLogger() + var ErrNilJPushAdminAPIv1 = newNilAPIError("jpush", "admin", 1) + var ErrNilJPushDeviceAPIv3 = newNilAPIError("jpush", "device", 3) + var ErrNilJPushFileAPIv3 = newNilAPIError("jpush", "file", 3) + var ErrNilJPushGroupPushAPIv3 = newNilAPIError("jpush", "group push", 3) + var ErrNilJPushGroupReportAPIv3 = newNilAPIError("jpush", "group report", 3) + var ErrNilJPushImageAPIv3 = newNilAPIError("jpush", "image", 3) + var ErrNilJPushPushAPIv3 = newNilAPIError("jpush", "push", 3) + var ErrNilJPushReportAPIv3 = newNilAPIError("jpush", "report", 3) + var ErrNilJPushScheduleAPIv3 = newNilAPIError("jpush", "schedule", 3) + type Client interface + Do func(req *http.Request) (resp *http.Response, err error) + var DefaultClient Client = &http.Client{ ... } + type CodeError struct + Code int + Message string + func (e *CodeError) Error() string + func (e *CodeError) IsSuccess() bool + func (e *CodeError) String() string + type FileValidator struct + AllowedExts []string + AllowedMimes []string + MaxSize int64 + func (fv *FileValidator) Validate(fileReader io.Reader, fileName string) error + type FormField struct + Name string + Value string + type FormFile struct + FieldName string + FileData interface{} + FileName string + type HttpClient interface + DetectProto func(url string) string + FormRequest func(ctx context.Context, req *Request) (resp *Response, err error) + Request func(ctx context.Context, req *Request) (resp *Response, err error) + func NewHttpClient(client Client, logger jiguang.Logger, level HttpLogLevel) HttpClient + type HttpLogLevel uint8 + const HttpLogLevelBasic + const HttpLogLevelFull + const HttpLogLevelHeaders + const HttpLogLevelNone + func (level HttpLogLevel) IsValid() bool + func (level HttpLogLevel) String() string + type MultipartFormDataBody struct + Fields []FormField + FileValidator *FileValidator + Files []FormFile + func (mfd MultipartFormDataBody) Prepare(writer *multipart.Writer) error + type Rate struct + Limit int + Remaining int + Reset int64 + func ParseRate(resp *http.Response) Rate + type Request struct + Auth string + Body interface{} + Method string + Proto string + URL string + type Response struct + Header http.Header + Rate Rate + RawBody []byte + StatusCode int + func (resp *Response) IsNoContent() bool + func (resp *Response) RateLimit() int + func (resp *Response) RateRemaining() int + func (resp *Response) RateReset() int64 + func (resp *Response) String() string