Go client

Install

GOPRIVATE=eagraiclainne.ie go get eagraiclainne.ie/pkg/client

eagraiclainne.ie serves the module redirect to the repository. GOPRIVATE skips the public proxy and checksum database, and the clone uses your Forgejo credentials.

Quick start

Sign in, hold the token, make calls — here Cormac adds Saturday's match from a script:

package main

import (
    "context"
    "log"

    "eagraiclainne.ie/pkg/client"
    corev1 "eagraiclainne.ie/gen/go/api/core/v1"
)

func main() {
    ctx := context.Background()

    c, err := client.New("http://your-server:8080", nil)
    if err != nil {
        log.Fatal(err)
    }

    login, err := c.Users.Login(ctx, "cormac@example.ie", "password")
    if err != nil {
        log.Fatal(err)
    }
    c.SetAuthToken(login.Token)

    _, err = c.Events.Create(ctx, &client.CreateEventParams{
        Name: "Football match",
        Type: corev1.EventType_EVENT_TYPE_APPOINTMENT,
    })
    if err != nil {
        log.Fatal(err)
    }
}

Services

ServiceCovers
c.Usersaccounts, login, roles, relations
c.Eventscalendar events, participants
c.Itemsjobs, assignment, deadlines, completion
c.Rewardsgranting and claiming rewards
c.ApiKeysmachine credentials (admin)

The full reference with every method lives in the repository at pkg/client/README.md, and each method carries godoc.