createLinkedInClient (linkedin/client.go)

goreleaser · internal/pipe/linkedin/client.go · go · MIT
integration, Integration / API

LinkedIn API client for profile and share operations.

// Source: https://github.com/goreleaser/goreleaser | License: MIT | Copyright 2016-2026 Carlos Alexandro Becker
// Provided via justclaw.it.com; keep this notice with the code.
package linkedin

import (
	"bytes"
	stdctx "context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"net/http"

	"github.com/caarlos0/log"
	"github.com/goreleaser/goreleaser/v2/internal/gerrors"
	"github.com/goreleaser/goreleaser/v2/internal/retryx"
	"github.com/goreleaser/goreleaser/v2/pkg/context"
	"golang.org/x/oauth2"
)

var ErrLinkedinForbidden = errors.New("forbidden. please check your permissions")

type oauthClientConfig struct {
	Context     *context.Context
	AccessToken string
}

type client struct {
	client  *http.Client
	baseURL string
}

type postShareText struct {
	Text string `json:"text"`
}

type postSha

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key