api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package api provides types for API requests and responses shared between CLI and server.

Package api provides shared utility functions for CLI and API clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetManagementToken

func GetManagementToken(cmd *cobra.Command) (string, error)

GetManagementToken gets the management token from a cobra command or environment.

func ObfuscateKey

func ObfuscateKey(key string) string

ObfuscateKey obfuscates a sensitive key for display.

func ParseTimeHeader

func ParseTimeHeader(val string) time.Time

ParseTimeHeader parses a time header in RFC3339Nano format.

Types

type ProjectCreateRequest

type ProjectCreateRequest struct {
	Name   string `json:"name"`
	APIKey string `json:"api_key"`
}

ProjectCreateRequest is the request body for creating a project.

type ProjectCreateResponse

type ProjectCreateResponse struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	APIKey    string    `json:"api_key"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

ProjectCreateResponse is the response body for a created project.

type TokenCreateRequest

type TokenCreateRequest struct {
	ProjectID       string `json:"project_id"`
	DurationMinutes int    `json:"duration_minutes"`
	MaxRequests     *int   `json:"max_requests,omitempty"`
}

TokenCreateRequest is the request body for creating a token.

type TokenCreateResponse

type TokenCreateResponse struct {
	Token       string    `json:"token"`
	ExpiresAt   time.Time `json:"expires_at"`
	MaxRequests *int      `json:"max_requests,omitempty"`
}

TokenCreateResponse is the response body for a created token.

Jump to

Keyboard shortcuts

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