Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Call(method, path string, header map[string]string, body io.Reader, v interface{}) error
- func (c *Client) ExecuteRequest(req *http.Request, v interface{}) error
- func (c *Client) NewRequest(method string, fullPath string, headers map[string]string, body io.Reader) (*http.Request, error)
- type CoreGateway
- func (gateway *CoreGateway) Call(method, path string, header map[string]string, body io.Reader, v interface{}) error
- func (gateway *CoreGateway) CreateVA(token string, req CreateVaRequest) (res VaResponse, err error)
- func (gateway *CoreGateway) DeleteVA(token string, req DeleteVaRequest) (res VaDeleteResponse, err error)
- func (gateway *CoreGateway) GetInformationVA(token string, req GetInformationVaRequest) (res VaInformationResponse, err error)
- func (gateway *CoreGateway) GetReportVA(token string, req GetReportVaRequest) (res VaReportResponse, err error)
- func (gateway *CoreGateway) GetToken() (res TokenResponse, err error)
- func (gateway *CoreGateway) UpdateVA(token string, req CreateVaRequest) (res VaResponse, err error)
- type CreateVaRequest
- type DeleteVaRequest
- type GetInformationVaRequest
- type GetReportVaRequest
- type TokenResponse
- type VaData
- type VaDeleteData
- type VaDeleteResponse
- type VaInformationData
- type VaInformationResponse
- type VaReportData
- type VaReportResponse
- type VaResponse
Constants ¶
View Source
const ( TOKEN_PATH = "/oauth/client_credential/accesstoken?grant_type=client_credentials" VA_PATH = "/v1/briva" VA_REPORT_PATH = "/v1/briva/report" VA_INFORMATION_PATH = "/v1/briva/status" BRI_TIME_FORMAT = "2006-01-02T15:04:05.999Z" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseUrl string ClientId string ClientSecret string InstitutionCode string BrivaNo string LogLevel int Logger *log.Logger }
func NewClient ¶
func NewClient() Client
NewClient : this function will always be called when the library is in use
func (*Client) Call ¶
func (c *Client) Call(method, path string, header map[string]string, body io.Reader, v interface{}) error
Call the BRI API at specific `path` using the specified HTTP `method`. The result will be given to `v` if there is no error. If any error occurred, the return of this function is the error itself, otherwise nil.
func (*Client) ExecuteRequest ¶
ExecuteRequest : execute request
type CoreGateway ¶
type CoreGateway struct {
Client Client
}
CoreGateway struct
func (*CoreGateway) Call ¶
func (gateway *CoreGateway) Call(method, path string, header map[string]string, body io.Reader, v interface{}) error
Call : base method to call Core API
func (*CoreGateway) CreateVA ¶
func (gateway *CoreGateway) CreateVA(token string, req CreateVaRequest) (res VaResponse, err error)
func (*CoreGateway) DeleteVA ¶
func (gateway *CoreGateway) DeleteVA(token string, req DeleteVaRequest) (res VaDeleteResponse, err error)
func (*CoreGateway) GetInformationVA ¶
func (gateway *CoreGateway) GetInformationVA(token string, req GetInformationVaRequest) (res VaInformationResponse, err error)
func (*CoreGateway) GetReportVA ¶
func (gateway *CoreGateway) GetReportVA(token string, req GetReportVaRequest) (res VaReportResponse, err error)
func (*CoreGateway) GetToken ¶
func (gateway *CoreGateway) GetToken() (res TokenResponse, err error)
func (*CoreGateway) UpdateVA ¶
func (gateway *CoreGateway) UpdateVA(token string, req CreateVaRequest) (res VaResponse, err error)
type CreateVaRequest ¶
type DeleteVaRequest ¶
type GetInformationVaRequest ¶
type GetReportVaRequest ¶
type TokenResponse ¶
type VaDeleteData ¶
type VaDeleteResponse ¶
type VaDeleteResponse struct { Status bool `json:"status"` ResponseCode string `json:"responseCode"` ResponseDescription string `json:"responseDescription"` Data VaDeleteData `json:"data"` }
type VaInformationData ¶
type VaInformationData struct {
Status string `json:"statusBayar"`
}
type VaInformationResponse ¶
type VaInformationResponse struct { Status bool `json:"status"` ResponseCode string `json:"responseCode"` ResponseDescription string `json:"responseDescription"` Data VaInformationData `json:"data"` }
type VaReportData ¶
type VaReportResponse ¶
type VaReportResponse struct { Status bool `json:"status"` ResponseCode string `json:"responseCode"` Description string `json:"responseDescription"` ErrDesc string `json:"errDesc"` Data []VaReportData `json:"data"` }
Click to show internal directories.
Click to hide internal directories.