gokirimwa

package module
v0.0.0-...-897394d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 7 Imported by: 0

README

go-kirimwa

Unofficial Go's Wrapper For kirimwa.id

Documentation

Index

Constants

View Source
const DEVICE = "devices"

Variables

This section is empty.

Functions

func IsKirimWAError

func IsKirimWAError(err error) bool

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewKirimWA

func NewKirimWA(apiKey string) *Client

func NewKirimWAMockWithClient

func NewKirimWAMockWithClient(apiKey string, httpClient HTTPClient) *Client

func (Client) DeleteDevice

func (c Client) DeleteDevice(deviceID string) (err error)

func (Client) RegisterDevice

func (c Client) RegisterDevice(deviceID string) (resp RegisterDeviceResponse, err error)

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

func (ErrorResponse) Error

func (er ErrorResponse) Error() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type RegisterDeviceRequest

type RegisterDeviceRequest struct {
	DeviceID string `json:"device_id"`
}

type RegisterDeviceResponse

type RegisterDeviceResponse struct {
	ID        string    `json:"id"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"created_at"`
	Meta      struct {
		Location string `json:"location"`
	} `json:"meta"`
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL