adminclient

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIAuthAuthenticator

type CLIAuthAuthenticator struct {
	Name    string                      `json:"name"`
	Enabled bool                        `json:"enabled"`
	Config  cliauth.AuthenticatorConfig `json:"config"`
}

type CLIAuthLogin

type CLIAuthLogin struct {
	LoginID           string `json:"login_id"`
	Status            string `json:"status"`
	AuthenticatorName string `json:"authenticator_name"`
	Message           string `json:"message,omitempty"`
}

type CLIAuthLoginStatus

type CLIAuthLoginStatus struct {
	LoginID           string `json:"login_id"`
	AuthenticatorName string `json:"authenticator_name"`
	Status            string `json:"status"`
	StartedAt         any    `json:"started_at,omitempty"`
	FinishedAt        any    `json:"finished_at,omitempty"`
	Phase             string `json:"phase,omitempty"`
	Message           string `json:"message,omitempty"`
	VerificationURL   string `json:"verification_url,omitempty"`
	UserCode          string `json:"user_code,omitempty"`
	Error             string `json:"error,omitempty"`
	CredentialID      string `json:"credential_id,omitempty"`
}

type CLIAuthRefresherStatus

type CLIAuthRefresherStatus struct {
	Enabled bool `json:"enabled"`
}

type CLIAuthUpdateAuthenticatorResponse

type CLIAuthUpdateAuthenticatorResponse struct {
	Status        string               `json:"status"`
	Authenticator CLIAuthAuthenticator `json:"authenticator"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config) *Client

func (*Client) BaseURL

func (c *Client) BaseURL() string

func (*Client) CreateCredential

func (c *Client) CreateCredential(ctx context.Context, req CreateCredentialRequest) (*ManagedCredential, error)

func (*Client) CreateManagedModel

func (c *Client) CreateManagedModel(ctx context.Context, model modelcatalog.ManagedModel) (*ManagedModel, error)

func (*Client) CreateProvider

func (c *Client) CreateProvider(ctx context.Context, cfg ProviderConfig) (*Provider, error)

func (*Client) CreateRoute

func (c *Client) CreateRoute(ctx context.Context, route RouteConfig) (*RouteConfig, error)

func (*Client) CreateVirtualKey

func (c *Client) CreateVirtualKey(ctx context.Context, key VirtualKeyConfig) (*VirtualKeyConfig, error)

func (*Client) DeleteCredential

func (c *Client) DeleteCredential(ctx context.Context, id string) (*StatusResponse, error)

func (*Client) DeleteManagedModel

func (c *Client) DeleteManagedModel(ctx context.Context, providerID, upstreamModel string) (*StatusResponse, error)

func (*Client) DeleteProvider

func (c *Client) DeleteProvider(ctx context.Context, id string) (*StatusResponse, error)

func (*Client) DeleteRoute

func (c *Client) DeleteRoute(ctx context.Context, id string) (*StatusResponse, error)

func (*Client) DeleteVirtualKey

func (c *Client) DeleteVirtualKey(ctx context.Context, id string) (*StatusResponse, error)

func (*Client) DisableCLIAuthRefresher

func (c *Client) DisableCLIAuthRefresher(ctx context.Context) (*boolStatusResponse, error)

func (*Client) DisableProvider

func (c *Client) DisableProvider(ctx context.Context, id string) (*Provider, error)

func (*Client) DisableProviderType

func (c *Client) DisableProviderType(ctx context.Context, providerType string) (*boolStatusResponse, error)

func (*Client) DisableRoute

func (c *Client) DisableRoute(ctx context.Context, id string) (*Route, error)

func (*Client) DisableVirtualKey

func (c *Client) DisableVirtualKey(ctx context.Context, id string) (*VirtualKey, error)

func (*Client) EnableCLIAuthRefresher

func (c *Client) EnableCLIAuthRefresher(ctx context.Context) (*boolStatusResponse, error)

func (*Client) EnableProvider

func (c *Client) EnableProvider(ctx context.Context, id string) (*Provider, error)

func (*Client) EnableProviderType

func (c *Client) EnableProviderType(ctx context.Context, providerType string) (*boolStatusResponse, error)

func (*Client) EnableRoute

func (c *Client) EnableRoute(ctx context.Context, id string) (*Route, error)

func (*Client) EnableVirtualKey

func (c *Client) EnableVirtualKey(ctx context.Context, id string) (*VirtualKey, error)

func (*Client) GetCLIAuthAuthenticator

func (c *Client) GetCLIAuthAuthenticator(ctx context.Context, name string) (*CLIAuthAuthenticator, error)

func (*Client) GetCLIAuthLoginStatus

func (c *Client) GetCLIAuthLoginStatus(ctx context.Context, loginID string) (*CLIAuthLoginStatus, error)

func (*Client) GetCLIAuthRefresherStatus

func (c *Client) GetCLIAuthRefresherStatus(ctx context.Context) (*CLIAuthRefresherStatus, error)

func (*Client) GetCredential

func (c *Client) GetCredential(ctx context.Context, id string) (*Credential, error)

func (*Client) GetManagedModel

func (c *Client) GetManagedModel(ctx context.Context, providerID, upstreamModel string) (*ManagedModel, error)

func (*Client) GetProvider

func (c *Client) GetProvider(ctx context.Context, id string) (*Provider, error)

func (*Client) GetRoute

func (c *Client) GetRoute(ctx context.Context, id string) (*Route, error)

func (*Client) GetVirtualKey

func (c *Client) GetVirtualKey(ctx context.Context, id string) (*VirtualKey, error)

func (*Client) ListCLIAuthAuthenticators

func (c *Client) ListCLIAuthAuthenticators(ctx context.Context) ([]CLIAuthAuthenticator, error)

func (*Client) ListCredentials

func (c *Client) ListCredentials(ctx context.Context, opts CredentialListOptions) ([]Credential, error)

func (*Client) ListDiscoveredModels

func (c *Client) ListDiscoveredModels(ctx context.Context, providerID string) ([]DiscoveredModel, error)

func (*Client) ListLLMAPIHandlerTypes

func (c *Client) ListLLMAPIHandlerTypes(ctx context.Context) ([]LLMAPIHandlerType, error)

func (*Client) ListManagedModels

func (c *Client) ListManagedModels(ctx context.Context, opts ManagedModelListOptions) ([]ManagedModel, error)

func (*Client) ListProviderTypes

func (c *Client) ListProviderTypes(ctx context.Context) ([]ProviderType, error)

func (*Client) ListProviders

func (c *Client) ListProviders(ctx context.Context, opts ProviderListOptions) ([]Provider, error)

func (*Client) ListRoutes

func (c *Client) ListRoutes(ctx context.Context, opts RouteListOptions) ([]Route, error)

func (*Client) ListVirtualKeys

func (c *Client) ListVirtualKeys(ctx context.Context, opts VirtualKeyListOptions) ([]VirtualKey, error)

func (*Client) Login

func (c *Client) Login(ctx context.Context) (*LoginResponse, error)

func (*Client) Logout

func (c *Client) Logout(ctx context.Context) error

func (*Client) Me

func (c *Client) Me(ctx context.Context) (*MeResponse, error)

func (*Client) RefreshProviderModels

func (c *Client) RefreshProviderModels(ctx context.Context, providerID string) (*RefreshDiscoveredModelsResponse, error)

func (*Client) SetToken

func (c *Client) SetToken(token string)

func (*Client) StartCLIAuthLogin

func (c *Client) StartCLIAuthLogin(ctx context.Context, name string, req StartCLIAuthLoginRequest) (*CLIAuthLogin, error)

func (*Client) UpdateCredential

func (c *Client) UpdateCredential(ctx context.Context, id string, req UpdateCredentialRequest) (*ManagedCredential, error)

func (*Client) UpdateManagedModel

func (c *Client) UpdateManagedModel(ctx context.Context, providerID, upstreamModel string, model modelcatalog.ManagedModel) (*ManagedModel, error)

func (*Client) UpdateProvider

func (c *Client) UpdateProvider(ctx context.Context, id string, cfg ProviderConfig) (*Provider, error)

func (*Client) UpdateRoute

func (c *Client) UpdateRoute(ctx context.Context, id string, route RouteConfig) (*RouteConfig, error)

func (*Client) UpdateVirtualKey

func (c *Client) UpdateVirtualKey(ctx context.Context, id string, req VirtualKeyConfig) (*VirtualKeyConfig, error)

type Config

type Config struct {
	BaseURL    string
	Username   string
	Password   string
	Token      string
	HTTPClient *http.Client
}

type CreateCredentialRequest

type CreateCredentialRequest struct {
	ID           string            `json:"id,omitempty"`
	Type         string            `json:"type"`
	ProviderType string            `json:"provider_type,omitempty"`
	ProviderID   string            `json:"provider_id"`
	Label        string            `json:"label,omitempty"`
	Attributes   map[string]string `json:"attributes,omitempty"`
	Metadata     map[string]any    `json:"metadata,omitempty"`
	Disabled     bool              `json:"disabled,omitempty"`
}

type Credential

type Credential = adminapi.CredentialView

type CredentialListOptions

type CredentialListOptions struct {
	ProviderType string
	ProviderID   string
	Type         string
}

type Error

type Error struct {
	StatusCode int
	Message    string
	Body       []byte
}

func (*Error) Error

func (e *Error) Error() string

type LLMAPIHandlerType

type LLMAPIHandlerType = adminapi.LLMApiHandlerTypeView

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Token    string `json:"token"`
	Username string `json:"username"`
}

type ManagedCredential

type ManagedCredential = credentialmgr.ManagedCredential

type ManagedModelListOptions

type ManagedModelListOptions struct {
	ProviderID string
}

type MeResponse

type MeResponse struct {
	Username  string    `json:"username"`
	CreatedAt time.Time `json:"created_at"`
}

type Provider

type Provider = adminapi.ProviderView

type ProviderConfig

type ProviderConfig = provider.ProviderConfig

type ProviderListOptions

type ProviderListOptions struct {
	ProviderType string
}

type ProviderType

type ProviderType = adminapi.ProviderTypeView

type RefreshDiscoveredModelsResponse

type RefreshDiscoveredModelsResponse struct {
	ProviderID string            `json:"provider_id"`
	Items      []DiscoveredModel `json:"items"`
}

type Route

type Route = adminapi.RouteView

type RouteConfig

type RouteConfig = routepkg.AgentRoute

type RouteListOptions

type RouteListOptions struct {
	Tag       string
	TagPrefix string
}

type StartCLIAuthLoginRequest

type StartCLIAuthLoginRequest struct {
	ProviderID string `json:"provider_id"`
	Scope      string `json:"scope,omitempty"`
}

type StatusResponse

type StatusResponse struct {
	Status string `json:"status"`
	ID     string `json:"id,omitempty"`
	Key    string `json:"key,omitempty"`
}

type UpdateCLIAuthAuthenticatorRequest

type UpdateCLIAuthAuthenticatorRequest struct {
	Enabled *bool                        `json:"enabled,omitempty"`
	Config  *cliauth.AuthenticatorConfig `json:"config,omitempty"`
}

type UpdateCredentialRequest

type UpdateCredentialRequest struct {
	Type         string            `json:"type,omitempty"`
	ProviderType string            `json:"provider_type,omitempty"`
	ProviderID   string            `json:"provider_id,omitempty"`
	Label        string            `json:"label,omitempty"`
	Attributes   map[string]string `json:"attributes,omitempty"`
	Metadata     map[string]any    `json:"metadata,omitempty"`
	Disabled     bool              `json:"disabled,omitempty"`
}

type VirtualKey

type VirtualKey = adminapi.VirtualKeyView

type VirtualKeyConfig

type VirtualKeyConfig struct {
	ID              string    `json:"id,omitempty"`
	Tag             string    `json:"tag,omitempty"`
	Description     string    `json:"description,omitempty"`
	Disabled        bool      `json:"disabled,omitempty"`
	AllowedRouteIDs []string  `json:"allowed_route_ids,omitempty"`
	StatusMessage   string    `json:"status_message,omitempty"`
	ExpiresAt       time.Time `json:"expires_at,omitempty"`
}

type VirtualKeyListOptions

type VirtualKeyListOptions struct {
	Tag string
}

Jump to

Keyboard shortcuts

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