Documentation
¶
Index ¶
- type CreateMCPServerRequest
- type HeadersMap
- type MCPServer
- type MCPServerRepo
- func (r *MCPServerRepo) Create(ctx context.Context, projectId uuid.UUID, req *CreateMCPServerRequest) (*MCPServer, error)
- func (r *MCPServerRepo) Delete(ctx context.Context, projectId uuid.UUID, id uuid.UUID) error
- func (r *MCPServerRepo) GetByID(ctx context.Context, projectId uuid.UUID, id uuid.UUID) (*MCPServer, error)
- func (r *MCPServerRepo) GetByIDs(ctx context.Context, projectId uuid.UUID, ids []uuid.UUID) (map[uuid.UUID]*MCPServer, error)
- func (r *MCPServerRepo) GetByName(ctx context.Context, projectId uuid.UUID, name string) (*MCPServer, error)
- func (r *MCPServerRepo) List(ctx context.Context, projectId uuid.UUID) ([]*MCPServer, error)
- func (r *MCPServerRepo) Update(ctx context.Context, projectId uuid.UUID, id uuid.UUID, ...) (*MCPServer, error)
- type MCPServerService
- func (s *MCPServerService) Create(ctx context.Context, projectID uuid.UUID, req *CreateMCPServerRequest) (*MCPServer, error)
- func (s *MCPServerService) Delete(ctx context.Context, projectID uuid.UUID, id uuid.UUID) error
- func (s *MCPServerService) GetByID(ctx context.Context, projectID uuid.UUID, id uuid.UUID) (*MCPServer, error)
- func (s *MCPServerService) GetByIDs(ctx context.Context, projectID uuid.UUID, ids []uuid.UUID) (map[uuid.UUID]*MCPServer, error)
- func (s *MCPServerService) GetByName(ctx context.Context, projectID uuid.UUID, name string) (*MCPServer, error)
- func (s *MCPServerService) List(ctx context.Context, projectID uuid.UUID) ([]*MCPServer, error)
- func (s *MCPServerService) Update(ctx context.Context, projectID uuid.UUID, id uuid.UUID, ...) (*MCPServer, error)
- type UpdateMCPServerRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateMCPServerRequest ¶
type CreateMCPServerRequest struct {
Name string `json:"name" validate:"required,min=1,max=255"`
Endpoint string `json:"endpoint" validate:"required,min=1,max=500,url"`
Headers HeadersMap `json:"headers" validate:"omitempty"`
}
CreateMCPServerRequest represents the request to create a new MCP server
type HeadersMap ¶
HeadersMap represents a map of headers that can be stored in JSONB
func (HeadersMap) MarshalJSON ¶
func (h HeadersMap) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*HeadersMap) Scan ¶
func (h *HeadersMap) Scan(value interface{}) error
Scan implements the sql.Scanner interface for database/sql
func (*HeadersMap) UnmarshalJSON ¶
func (h *HeadersMap) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
type MCPServer ¶
type MCPServer struct {
ID uuid.UUID `json:"id" db:"id"`
Name string `json:"name" db:"name"`
Endpoint string `json:"endpoint" db:"endpoint"`
Headers HeadersMap `json:"headers" db:"headers"`
ProjectID uuid.UUID `json:"project_id" db:"project_id"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}
MCPServer represents an MCP server configuration
type MCPServerRepo ¶
type MCPServerRepo struct {
// contains filtered or unexported fields
}
MCPServerRepo handles database operations for MCP servers
func NewMCPServerRepo ¶
func NewMCPServerRepo(db *sqlx.DB) *MCPServerRepo
NewMCPServerRepo creates a new MCP server repository
func (*MCPServerRepo) Create ¶
func (r *MCPServerRepo) Create(ctx context.Context, projectId uuid.UUID, req *CreateMCPServerRequest) (*MCPServer, error)
Create creates a new MCP server
func (*MCPServerRepo) GetByID ¶
func (r *MCPServerRepo) GetByID(ctx context.Context, projectId uuid.UUID, id uuid.UUID) (*MCPServer, error)
GetByID retrieves an MCP server by ID
func (*MCPServerRepo) GetByIDs ¶
func (r *MCPServerRepo) GetByIDs(ctx context.Context, projectId uuid.UUID, ids []uuid.UUID) (map[uuid.UUID]*MCPServer, error)
GetByIDs retrieves multiple MCP servers by IDs in a single query
func (*MCPServerRepo) GetByName ¶
func (r *MCPServerRepo) GetByName(ctx context.Context, projectId uuid.UUID, name string) (*MCPServer, error)
GetByName retrieves an MCP server by name
type MCPServerService ¶
type MCPServerService struct {
// contains filtered or unexported fields
}
MCPServerService handles business logic for MCP servers
func NewMCPServerService ¶
func NewMCPServerService(repo *MCPServerRepo) *MCPServerService
NewMCPServerService creates a new MCP server service
func (*MCPServerService) Create ¶
func (s *MCPServerService) Create(ctx context.Context, projectID uuid.UUID, req *CreateMCPServerRequest) (*MCPServer, error)
Create creates a new MCP server
func (*MCPServerService) GetByID ¶
func (s *MCPServerService) GetByID(ctx context.Context, projectID uuid.UUID, id uuid.UUID) (*MCPServer, error)
GetByID retrieves an MCP server by ID
func (*MCPServerService) GetByIDs ¶
func (s *MCPServerService) GetByIDs(ctx context.Context, projectID uuid.UUID, ids []uuid.UUID) (map[uuid.UUID]*MCPServer, error)
GetByIDs retrieves multiple MCP servers by IDs in a single query
func (*MCPServerService) GetByName ¶
func (s *MCPServerService) GetByName(ctx context.Context, projectID uuid.UUID, name string) (*MCPServer, error)
GetByName retrieves an MCP server by name
type UpdateMCPServerRequest ¶
type UpdateMCPServerRequest struct {
Name *string `json:"name,omitempty" validate:"omitempty,min=1,max=255"`
Endpoint *string `json:"endpoint,omitempty" validate:"omitempty,min=1,max=500,url"`
Headers *HeadersMap `json:"headers,omitempty"`
}
UpdateMCPServerRequest represents the request to update an MCP server