Documentation
¶
Index ¶
- Variables
- func NewRuntime(d *Dependencies) mdk.Runtime
- func NormalizeModuleID(id string) string
- func QueryGraphQL(serverURL string, query string, variables map[string]any, out any) error
- func Register(m Module)
- func RegisterCommand(cmd CLICommand)
- func RegisterFactory(id string, factory ModuleFactory)
- func RegisterMiddleware(name string, mw Middleware)
- type ActorResolver
- type CLICommand
- type Dependencies
- type Factory
- type GetPromptResult
- type GraphQLProvider
- type GraphQLRequest
- type GraphQLResponse
- type LineageData
- type MCPPrompt
- type MCPPromptArgument
- type MCPPromptMessage
- type MCPPromptMessageContent
- type MCPResource
- type Middleware
- type Module
- type ModuleFactory
- type OrderResult
- type Projector
- type PromptProvider
- type Registry
- type ResourceProvider
- type Route
- type WorkflowRegistry
- type WorkflowRunner
Constants ¶
This section is empty.
Variables ¶
var Timeout = getTimeoutFromEnv()
Timeout defines the maximum duration for GraphQL network operations.
Functions ¶
func NewRuntime ¶
func NewRuntime(d *Dependencies) mdk.Runtime
NewRuntime wraps Dependencies to satisfy the mdk.Runtime interface.
func NormalizeModuleID ¶
NormalizeModuleID standardizes module IDs by removing common repo prefixes and replacing slashes with dots. E.g., "github.com/GoHyperrr/commerce/hotel" -> "commerce.hotel"
func QueryGraphQL ¶
QueryGraphQL performs HTTP POST queries to retrieve and deserialize remote data.
func RegisterCommand ¶
func RegisterCommand(cmd CLICommand)
RegisterCommand adds a dynamic CLI subcommand to the registry.
func RegisterFactory ¶
func RegisterFactory(id string, factory ModuleFactory)
RegisterFactory registers a module constructor in the global factory registry.
func RegisterMiddleware ¶
func RegisterMiddleware(name string, mw Middleware)
RegisterMiddleware adds a named middleware to the registry.
Types ¶
type ActorResolver ¶
type ActorResolver interface {
GetActorByAPIKey(ctx context.Context, key string) (identity.Actor, error)
}
ActorResolver defines the interface for resolving identities.
type CLICommand ¶
type CLICommand struct {
Group string // Command group: "auth", "commerce", etc.
Name string // Subcommand name: "apikey", "product", etc.
Aliases []string // Alternative names
Short string // One-line description
Long string // Detailed description (shown in --help)
Usage string // Args pattern: "generate", "<email> <password>"
Run func(rt mdk.Runtime, args []string) error
NeedsDB bool // If true, auto-connect DB before Run
NeedsServer bool // If true, requires running server (validates connectivity)
}
CLICommand represents a dynamic subcommand registered by a module.
func GetCommand ¶
func GetCommand(key string) (CLICommand, bool)
GetCommand retrieves a registered custom command by its group/name key.
func ListCommands ¶
func ListCommands() []CLICommand
ListCommands returns a list of all registered custom CLI commands.
type Dependencies ¶
type Dependencies struct {
Config *config.Config
DB *db.DB
EventBus eventbus.EventBus
Runner WorkflowRunner
Registry WorkflowRegistry
Locker locking.Locker
Resolver ActorResolver
ServerURL string
}
Dependencies provides common utilities to modules.
type GetPromptResult ¶
type GetPromptResult = mdk.GetPromptResult
type GraphQLProvider ¶
type GraphQLProvider interface {
// Queries returns resolver function pointers keyed by GraphQL field name.
Queries() map[string]any
// Mutations returns resolver function pointers keyed by GraphQL field name.
Mutations() map[string]any
// FieldResolvers returns nested field resolvers (e.g. "WorkflowLineage.events").
FieldResolvers() map[string]any
}
GraphQLProvider is implemented by modules that expose GraphQL queries/mutations.
type GraphQLRequest ¶
type GraphQLRequest struct {
Query string `json:"query"`
Variables map[string]any `json:"variables,omitempty"`
}
GraphQLRequest defines the structure for outbound GraphQL operations.
type GraphQLResponse ¶
type GraphQLResponse struct {
Data json.RawMessage `json:"data"`
Errors []struct {
Message string `json:"message"`
} `json:"errors"`
}
GraphQLResponse wraps response payload format of GraphQL endpoints.
type LineageData ¶
type LineageData = mdk.LineageData
LineageData defines the minimal interface for accessing workflow execution data.
type MCPPromptArgument ¶
type MCPPromptArgument = mdk.MCPPromptArgument
type MCPPromptMessage ¶
type MCPPromptMessage = mdk.MCPPromptMessage
type MCPPromptMessageContent ¶
type MCPPromptMessageContent = mdk.MCPPromptMessageContent
type MCPResource ¶
type MCPResource = mdk.MCPResource
type Middleware ¶
Middleware is a standard HTTP middleware function.
func GetMiddleware ¶
func GetMiddleware(name string) (Middleware, bool)
GetMiddleware retrieves a middleware by name.
type Module ¶
Type aliases linking to mdk module/mcp structures to preserve backward compatibility.
type ModuleFactory ¶
ModuleFactory is a constructor function that instantiates a module with options. A module factory can also be auto-implemented or registered in package init().
func GetFactory ¶
func GetFactory(id string) (ModuleFactory, bool)
GetFactory retrieves a registered module constructor by its ID.
type OrderResult ¶
OrderResult defines the minimal interface for accessing order data across modules.
type PromptProvider ¶
type PromptProvider = mdk.PromptProvider
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages the set of available hyperrr modules.
func NewRegistry ¶
func NewRegistry() *Registry
NewRegistry creates a new, independent module registry.
type ResourceProvider ¶
type ResourceProvider = mdk.ResourceProvider