Mirror

Volodymyr Tkach 17efff2b41 Create FUNDING.yml 2 years ago
.github 17efff2b41 Create FUNDING.yml 2 years ago
donatello 4b23cd938a Fix: panic: runtime error: invalid memory address 2 years ago
.gitignore 75935ad9d9 Initial commit 2 years ago
LICENSE 75935ad9d9 Initial commit 2 years ago
Makefile 64b4dac39c Create Makefile 2 years ago
README.md 705c6457ab Update README.md 2 years ago
go.mod d05c4f176d Implement EachDonate func 2 years ago
go.sum 540ecedf0a First implementation 2 years ago
main.go d05c4f176d Implement EachDonate func 2 years ago

README.md

golang-donatello

Go API client for ukrainian donate platform donatello.to

https://donatello.to

Demo and testing

Example is here: https://github.com/vladimirok5959/golang-donatello/blob/main/main.go

export TOKEN="YOUR-TOKEN"
go run main.go

client.Me:
respMe: &v1.ResponseMe{
    Success: true,
    Message: "",
    NickName: "NickName",
    PubID: "A1B-A123456",
    Page: "https://donatello.to/nickname",
    IsActive: true,
    IsPublic: true,
    Donates: v1.ResponseMeDonates{
        TotalAmount: 10,
        TotalCount: 1
    },
    CreatedAt: "2022-10-20 00:30:50"
}
err: <nil>

client.Donates:
respDonates: &v1.ResponseDonates{
    Success: true,
    Message: "",
    Content: []v1.ResponseDonatesContent{
        v1.ResponseDonatesContent{
            PubID: "A1B-A123456",
            ClientName: "ClientName",
            Message: "Message",
            Amount: "100",
            Currency: "UAH",
            Goal: "",
            IsPublished: false,
            CreatedAt: "2022-10-20 00:30:50"
        }
    },
    Page: 1,
    Size: 20,
    Pages: 1,
    First: true,
    Last: true,
    Total: 1
}
err: <nil>

client.Clients:
respClients: &v1.ResponseClients{
    Success: true,
    Message: "",
    Clients: []v1.ResponseClientsClients{
        v1.ResponseClientsClients{
            ClientName: "ClientName",
            TotalAmount: 100
        }
    }
}
err: <nil>

client.EachDonate:
EachDonate: &v1.ResponseDonatesContent{
    PubID: "A1B-A123456",
    ClientName: "ClientName",
    Message: "Message",
    Amount: "100",
    Currency: "UAH",
    Goal: "",
    IsPublished: false,
    CreatedAt: "2022-10-20 00:30:50"
}

API faker included, see: https://github.com/vladimirok5959/golang-donatello/blob/main/donatello/v1/client_fake_api.go