Documentation ¶
Index ¶
- Variables
- type BuildingResponse
- type CategoryResponse
- type CityResponse
- type Client
- type CreateBuildingProblemRequest
- type CreateNearBuildingProblemRequest
- type CreateProblemRequest
- type CreateStreetProblemRequest
- type ErrorResponse
- type Message
- type NearestBuildingResponse
- type PositionType
- type ReasonResponse
- type ReqClient
- func (r *ReqClient) CreateSendProblemRequest(reasonId int64, body string, latitude float64, longitude float64) (map[string]string, error)
- func (r *ReqClient) GetNearestBuildings(latitude float64, longitude float64) (*NearestBuildingResponse, error)
- func (r *ReqClient) GetReasons() ([]CityResponse, error)
- func (r *ReqClient) Login(login string, password string) (*TokenResponse, error)
- func (r *ReqClient) Send(token string, fields map[string]string, files map[string][]byte) (*SentMessageResponse, error)
- type SentMessageResponse
- type TokenResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Errors = errorx.NewNamespace("OurSpbHttp") ErrTooManyRequests = Errors.NewType("TooManyRequests") ErrBadRequest = Errors.NewType("BadRequest") ErrFailedRequest = Errors.NewType("FailedRequest") ErrExpectingNotBuildingCoords = Errors.NewType("ExpectingNotBuildingCoords") ErrMatchesCoordsAndCategory = Errors.NewType("MatchesCoordsAndCategory") )
Functions ¶
This section is empty.
Types ¶
type BuildingResponse ¶
type CategoryResponse ¶
type CategoryResponse struct { Id int64 `json:"id"` Name string `json:"name"` Reasons []ReasonResponse `json:"reasons"` }
type CityResponse ¶
type CityResponse struct { Id int64 `json:"id"` Name string `json:"name"` Categories []CategoryResponse `json:"categories"` }
type Client ¶
type Client interface { Login(login string, password string) (*TokenResponse, error) GetNearestBuildings(latitude float64, longitude float64) (*NearestBuildingResponse, error) GetReasons() ([]CityResponse, error) Send(token string, fields map[string]string, files map[string][]byte) (*SentMessageResponse, error) CreateSendProblemRequest(reasonId int64, body string, latitude float64, longitude float64) ( map[string]string, error, ) }
type CreateBuildingProblemRequest ¶
type CreateBuildingProblemRequest struct { CreateStreetProblemRequest Building int64 `json:"building"` }
type CreateNearBuildingProblemRequest ¶
type CreateNearBuildingProblemRequest struct { CreateStreetProblemRequest NearestBuilding int64 `json:"nearest_building"` }
type CreateProblemRequest ¶
type CreateProblemRequest interface { }
type ErrorResponse ¶
func (*ErrorResponse) String ¶
func (r *ErrorResponse) String() string
type NearestBuildingResponse ¶
type NearestBuildingResponse struct {
Buildings []BuildingResponse `json:"buildings"`
}
type PositionType ¶
type PositionType int
const ( PositionTypeBuilding PositionType = 1 PositionTypeStreet PositionType = 2 PositionTypeNearBuilding PositionType = 4 //PositionTypeNearBuilding2 I have no idea why there are two types for the same thing PositionTypeNearBuilding2 PositionType = 5 )
type ReasonResponse ¶
type ReasonResponse struct { Id int64 `json:"id"` Name string `json:"name"` PositionType PositionType `json:"wizard_widget"` }
type ReqClient ¶
type ReqClient struct {
// contains filtered or unexported fields
}
func NewReqClient ¶ added in v0.20.0
func (*ReqClient) CreateSendProblemRequest ¶
func (*ReqClient) GetNearestBuildings ¶
func (r *ReqClient) GetNearestBuildings(latitude float64, longitude float64) (*NearestBuildingResponse, error)
func (*ReqClient) GetReasons ¶
func (r *ReqClient) GetReasons() ([]CityResponse, error)
type SentMessageResponse ¶ added in v1.0.0
type SentMessageResponse struct {
Id int `json:"id"`
}
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
}
Click to show internal directories.
Click to hide internal directories.