kinde

package module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

kinde-go

Kinde golang client

getting started

prerequisites
  1. Create a M2M application and save the domain, client ID, and client secret
  2. Authorise the application with the Kinde Management API and allow the relevant scopes
quickstart
package main

import "github.com/axatol/kinde-go"

func main() {
  // load config from environment variables
  // - KINDE_DOMAIN
  // - KINDE_AUDIENCE
  // - KINDE_CLIENT_ID
  // - KINDE_CLIENT_SECRET
  client := kinde.New(context.Background(), nil)

  // or override some configuration, the unspecified values are loaded from the
  // environment
  client = kinde.New(
    context.Background(),
    kinde.NewClientOptions().
      WithClientID("foo").
      WithClientSecret("bar").
      WithLogger(someLogger{})
  )
}

todo

  • pagination
  • rate-limiting

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	APIs         *apis.Client
	Applications *applications.Client
	Permissions  *permissions.Client
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, options *client.ClientOptions) Client

type KindeError

type KindeError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

func (KindeError) Error

func (e KindeError) Error() string

type KindeErrors

type KindeErrors []KindeError

func (KindeErrors) Error

func (errs KindeErrors) Error() string

func (KindeErrors) Has

func (errs KindeErrors) Has(code string) bool

func (*KindeErrors) UnmarshalJSON

func (errs *KindeErrors) UnmarshalJSON(data []byte) error

type NotFoundError added in v0.0.2

type NotFoundError struct {
	Kind string
	ID   string
}

func (NotFoundError) Error added in v0.0.2

func (err NotFoundError) Error() string

type RequestError added in v0.0.2

type RequestError struct {
	Method     string
	Path       string
	StatusCode int
	Err        error
}

func (RequestError) Error added in v0.0.2

func (err RequestError) Error() string

Directories

Path Synopsis
api
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL