Categorygithub.com/satraul/bca-go
modulepackage
1.0.2
Repository: https://github.com/satraul/bca-go.git
Documentation: pkg.go.dev

# README

bca-go

go-bca is the (unofficial) BCA SDK for the Go programming language.

This SDK was kickstarted by the OpenAPI Generator project.

Installation

go get github.com/satraul/bca-go

Usage

import (
    "log"

    bca "github.com/satraul/bca-go"
)

func main() {
    api := bca.NewAPIClient(bca.NewConfiguration())
    auth, err := api.Login(ctx, "username", "password", "1.2.3.4")
    if err != nil {
        panic(err)
    }

    balance, err := api.BalanceInquiry(ctx, auth)
    if err != nil {
        panic(err)
    }
    log.Printf("%+v\n", balance)

    if err := api.Logout(ctx, auth); err != nil {
        panic(err)
    }
}

See the a full example at example/example.go.

Documentation for API Endpoints

All URIs are relative to https://m.klikbca.com

ClassMethodHTTP requestDescription
BCAApiAccountStatementViewPost /accountstmt.do?value(actions)=acctstmtviewAccountStatementView
BCAApiBalanceInquiryPost /balanceinquiry.doBalanceInquiry
BCAApiLoginPost /authentication.doLogin
BCAApiLogoutGet /authentication.do?value(actions)=logoutLogout

Documentation For Authorization

Login will return session cookies ([]*http.Cookie) that are used for auth in all other endpoints.

Contributing

Pull requests are welcome.

License

MIT

# Packages

No description provided by the author

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
NewAPIResponse returns a new APIResonse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewConfiguration returns a new Configuration object.

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.

# Structs

APIClient manages communication with the BCA API v1.0 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
APIResponse stores the API response returned by the server.
Balance is data in balance inquiry.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Configuration stores the configuration of the API client.
Entry
Entry is a row in statement view.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.

# Type aliases

BCAApiService BCAApi service.