Documentation ¶
Index ¶
- Constants
- func GetXLimitHeader(r *http.Response, defaultXLimit int) int
- type HTTPRequester
- type OcpiRequestHeader
- type OcpiResponse
- func OcpiClientError(data interface{}, message string) *OcpiResponse
- func OcpiErrorMissingParameters(data interface{}) *OcpiResponse
- func OcpiErrorNotEnoughInformation(data interface{}) *OcpiResponse
- func OcpiErrorUnknownResource(data interface{}) *OcpiResponse
- func OcpiMissingEndpoints(data interface{}) *OcpiResponse
- func OcpiRegistrationError(data interface{}) *OcpiResponse
- func OcpiServerError(data interface{}, message string) *OcpiResponse
- func OcpiSuccess(data interface{}) *OcpiResponse
- func OcpiUnsupportedVersion(data interface{}) *OcpiResponse
- func UnmarshalResponseDto(body io.ReadCloser) (*OcpiResponse, error)
- type OcpiService
Constants ¶
View Source
const ( STATUS_CODE_OK = 1000 STATUS_CODE_CLIENT_ERROR = 2000 STATUS_CODE_MISSING_PARAMS = 2001 STATUS_CODE_NOT_ENOUGH_INFO = 2002 STATUS_CODE_UNKNOWN_RESOURCE = 2003 STATUS_CODE_SERVER_ERROR = 3000 STATUS_CODE_REGISTRATION_ERROR = 3001 STATUS_CODE_UNSUPPORTED_VERSION = 3002 STATUS_CODE_MISSING_ENDPOINTS = 3003 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OcpiRequestHeader ¶
func NewOcpiRequestHeader ¶
func NewOcpiRequestHeader(token *string, countryCode *string, partyID *string) OcpiRequestHeader
type OcpiResponse ¶
type OcpiResponse struct { Data interface{} `json:"data,omitempty"` StatusCode int16 `json:"status_code"` StatusMessage string `json:"status_message"` Timestamp ocpitype.Time `json:"timestamp"` }
func OcpiClientError ¶
func OcpiClientError(data interface{}, message string) *OcpiResponse
func OcpiErrorMissingParameters ¶
func OcpiErrorMissingParameters(data interface{}) *OcpiResponse
func OcpiErrorNotEnoughInformation ¶
func OcpiErrorNotEnoughInformation(data interface{}) *OcpiResponse
func OcpiErrorUnknownResource ¶
func OcpiErrorUnknownResource(data interface{}) *OcpiResponse
func OcpiMissingEndpoints ¶
func OcpiMissingEndpoints(data interface{}) *OcpiResponse
func OcpiRegistrationError ¶
func OcpiRegistrationError(data interface{}) *OcpiResponse
func OcpiServerError ¶
func OcpiServerError(data interface{}, message string) *OcpiResponse
func OcpiSuccess ¶
func OcpiSuccess(data interface{}) *OcpiResponse
func OcpiUnsupportedVersion ¶
func OcpiUnsupportedVersion(data interface{}) *OcpiResponse
func UnmarshalResponseDto ¶
func UnmarshalResponseDto(body io.ReadCloser) (*OcpiResponse, error)
func (*OcpiResponse) Error ¶
func (response *OcpiResponse) Error() string
func (*OcpiResponse) Render ¶
func (response *OcpiResponse) Render(writer http.ResponseWriter, request *http.Request) error
type OcpiService ¶ added in v0.3.1
type OcpiService struct {
HTTPRequester
}
func NewOcpiService ¶ added in v0.3.1
func NewOcpiService() *OcpiService
func (*OcpiService) Do ¶ added in v0.3.1
func (r *OcpiService) Do(method, url string, header OcpiRequestHeader, body io.Reader) (*http.Response, error)
Click to show internal directories.
Click to hide internal directories.