Go SDK

Go SDK

Module git.yelle.software/yelle/saas/meridian-ads/sdks/go. This stub will mirror sdks/go/README.md.

Install

Private GitLab modules need GOPRIVATE=git.yelle.software.

Go
export GOPRIVATE=git.yelle.software
go get git.yelle.software/yelle/saas/meridian-ads/sdks/go

Serve, render, click

Names below are illustrative until the package README lands. The locked contract is still serve(placement, userKey, context), impression on render, and the signed click URL.

Go
package main

import (
    "context"
    "os"

    meridianads "git.yelle.software/yelle/saas/meridian-ads/sdks/go"
)

func main() {
    client, err := meridianads.New(meridianads.Config{
        AppKey: os.Getenv("MERIDIAN_ADS_APP_KEY"),
        Secret: os.Getenv("MERIDIAN_ADS_APP_SECRET"),
    })
    if err != nil {
        panic(err)
    }
    dec, err := client.Serve(context.Background(), "home", "user-42", map[string]any{
        "country": "US",
        "plan":    "pro",
    })
    if err != nil || dec == nil {
        return
    }
    _ = client.Impression(context.Background(), dec.ImpressionToken())
    _ = dec.ClickURL()
}

Next

HMAC , sandbox , and 302 clicks .