gemini

package
v6.10.9-aug.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package gemini provides HTTP handlers for constant.Gemini CLI API functionality. This package implements handlers that process CLI-specific requests for constant.Gemini API operations, including content generation and streaming content generation endpoints. The handlers restrict access to localhost only and manage communication with the backend service.

Package gemini provides HTTP handlers for constant.Gemini API endpoints. This package implements handlers for managing constant.Gemini model operations including model listing, content generation, streaming content generation, and token counting. It serves as a proxy layer between clients and the constant.Gemini backend service, handling request translation, client management, and response processing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIHandler

type APIHandler struct {
	*handlers.BaseAPIHandler
}

APIHandler contains the handlers for constant.Gemini API endpoints. It holds a pool of clients to interact with the backend service.

func NewAPIHandler

func NewAPIHandler(apiHandlers *handlers.BaseAPIHandler) *APIHandler

NewAPIHandler creates a new constant.Gemini API handlers instance. It takes an BaseAPIHandler instance as input and returns a APIHandler.

func (*APIHandler) GeminiGetHandler

func (h *APIHandler) GeminiGetHandler(c *gin.Context)

GeminiGetHandler handles GET requests for specific constant.Gemini model information. It returns detailed information about a specific constant.Gemini model based on the action parameter.

func (*APIHandler) GeminiHandler

func (h *APIHandler) GeminiHandler(c *gin.Context)

GeminiHandler handles POST requests for constant.Gemini API operations. It routes requests to appropriate handlers based on the action parameter (model:method format).

func (*APIHandler) GeminiModels

func (h *APIHandler) GeminiModels(c *gin.Context)

GeminiModels handles the constant.Gemini models listing endpoint. It returns a JSON response containing available constant.Gemini models and their specifications.

func (*APIHandler) HandlerType

func (h *APIHandler) HandlerType() string

HandlerType returns the identifier for this handler implementation.

func (*APIHandler) Models

func (h *APIHandler) Models() []map[string]any

Models returns the constant.Gemini-compatible model metadata supported by this handler.

type CLIAPIHandler

type CLIAPIHandler struct {
	*handlers.BaseAPIHandler
}

CLIAPIHandler contains the handlers for constant.Gemini CLI API endpoints. It holds a pool of clients to interact with the backend service.

func NewCLIAPIHandler

func NewCLIAPIHandler(apiHandlers *handlers.BaseAPIHandler) *CLIAPIHandler

NewCLIAPIHandler creates a new constant.Gemini CLI API handlers instance. It takes an BaseAPIHandler instance as input and returns a CLIAPIHandler.

func (*CLIAPIHandler) CLIHandler

func (h *CLIAPIHandler) CLIHandler(c *gin.Context)

CLIHandler handles CLI-specific requests for constant.Gemini API operations. It restricts access to localhost only and routes requests to appropriate internal handlers.

func (*CLIAPIHandler) HandlerType

func (h *CLIAPIHandler) HandlerType() string

HandlerType returns the type of this handler.

func (*CLIAPIHandler) Models

func (h *CLIAPIHandler) Models() []map[string]any

Models returns a list of models supported by this handler.

Jump to

Keyboard shortcuts

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