apikey

package
v0.0.171 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, logger logger.Logger, baseUrl string, token string, id string) error

Types

type APIKey

type APIKey struct {
	ID         string  `json:"id"`
	Name       string  `json:"name"`
	OwnerId    string  `json:"ownerId"`
	OrgId      string  `json:"orgId"`
	ProjectId  string  `json:"projectId"`
	ExpiresAt  string  `json:"expiresAt"`
	LastUsedAt string  `json:"lastUsedAt"`
	Value      string  `json:"value"`
	Project    Project `json:"project"`
	User       User    `json:"user"`
	Org        Org     `json:"org"`
}

func Create

func Create(ctx context.Context, logger logger.Logger, baseUrl string, token string, orgId string, projectId string, name string, expiresAt string) (APIKey, error)

func Get

func Get(ctx context.Context, logger logger.Logger, baseUrl string, token string, id string) (*APIKey, error)

func List

func List(ctx context.Context, logger logger.Logger, baseUrl string, token string, orgId string, projectId string) ([]APIKey, error)

type CreateResponse

type CreateResponse = Response[APIKey]

type DeleteResponse

type DeleteResponse = Response[int]

type GetResponse

type GetResponse = Response[*APIKey]

type ListResponse

type ListResponse = Response[[]APIKey]

type Org

type Org struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Project

type Project struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Response

type Response[T any] struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    T      `json:"data"`
}

type User

type User struct {
	ID        string `json:"id"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	PhotoUrl  string `json:"photoUrl"`
}

Jump to

Keyboard shortcuts

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