Skip to content
/ golaget Public

(Golang) Go wrapper for Systembolagets (new) API

License

Notifications You must be signed in to change notification settings

lnus/golaget

Repository files navigation

GoLaget 🍺

GitHub go.mod Go version GitHub code size in bytes GitHub Go Report Card GitHub issues

GoLaget is a wrapper for Systembolagets V2 API. It currently includes every function listed under V2 on their open API. No plans to include V1 right now, since I don't personally need it. But feel free to PR in case you write it out. ​

Installation

go get github.com/lnus/golaget

For running the tests, the .env file should be populated with

PRIMARY_KEY=YOUR_PRIMARY_KEY

Please refer to the .env.example file for a safe configuration.

Usage

import "github.com/lnus/golaget"

func main() {
    instance = golaget.New(API_KEY, false) // API_KEY & verbose mode
    result, error := instance.GetAgents() // Returns a list of all agents
    for k, v := range *result {
        fmt.Println(v.AgentID, v.IsOpen, v.Phone, v.Address)
    }
}

Contributing ❤

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License ⚖

MIT

About

(Golang) Go wrapper for Systembolagets (new) API

Resources

License

Stars

Watchers

Forks

Packages

No packages published