Documentation
¶
Overview ¶
Package services provides a set of services for the MoLing application.
Package services provides a set of services for the MoLing application.
Package services provides a set of services for the MoLing application.
Index ¶
Constants ¶
View Source
const ( BrowserDataPath = "browser" // Path to store browser data BrowserServerName comm.MoLingServerType = "Browser" )
View Source
const BrowserPromptDefault = `` /* 1731-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BrowserConfig ¶
type BrowserConfig struct {
PromptFile string `json:"prompt_file"` // PromptFile is the prompt file for the browser.
Headless bool `json:"headless"`
Timeout int `json:"timeout"`
Proxy string `json:"proxy"`
UserAgent string `json:"user_agent"`
DefaultLanguage string `json:"default_language"`
URLTimeout int `json:"url_timeout"` // URLTimeout is the timeout for loading a URL. time.Second
SelectorQueryTimeout int `json:"selector_query_timeout"` // SelectorQueryTimeout is the timeout for CSS selector queries. time.Second
DataPath string `json:"data_path"` // DataPath is the path to the data directory.
BrowserDataPath string `json:"browser_data_path"` // BrowserDataPath is the path to the browser data directory.
// contains filtered or unexported fields
}
func NewBrowserConfig ¶
func NewBrowserConfig() *BrowserConfig
NewBrowserConfig creates a new BrowserConfig with default values.
func (*BrowserConfig) Check ¶
func (cfg *BrowserConfig) Check() error
type BrowserServer ¶
BrowserServer represents the configuration for the browser service.
func (*BrowserServer) Close ¶
func (bs *BrowserServer) Close() error
func (*BrowserServer) Config ¶
func (bs *BrowserServer) Config() string
Config returns the configuration of the service as a string.
func (*BrowserServer) Init ¶
func (bs *BrowserServer) Init() error
Init initializes the browser server by creating a new context.
func (*BrowserServer) LoadConfig ¶
func (bs *BrowserServer) LoadConfig(jsonData map[string]any) error
LoadConfig loads the configuration from a JSON object.
func (*BrowserServer) Name ¶
func (bs *BrowserServer) Name() comm.MoLingServerType
Click to show internal directories.
Click to hide internal directories.