browser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package browser 提供基于 logrus 的日志记录器

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRes

func AddRes(path ...string) string

AddTmp add res dir

func AddTmp

func AddTmp(path ...string) string

AddTmp add tmp dir

func AppendPath

func AppendPath(parent string, path ...string) string

AppendPath append path

func GetUnixTime

func GetUnixTime() int64

GetUnixTime

Types

type Logger

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

func NewLogger

func NewLogger(logFile string, logToFile, logToConsole bool) (*Logger, error)

NewLogger create logger func

func (*Logger) Close

func (l *Logger) Close() error

Close 关闭底层日志文件(如有)。推荐使用 defer 配合 NewLogger 调用。

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields ...logrus.Fields)

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...logrus.Fields)

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...logrus.Fields)

func (*Logger) Warn

func (l *Logger) Warn(msg string, fields ...logrus.Fields)

type RodClient

type RodClient interface {
	InitWebClient(wsurl string) *rod.Browser
	SearchParams(page *rod.Page, text string) (*rod.SearchResult, bool)
	SaveHTML(page *rod.Page, path string) bool
	SavePageScreen(pg *rod.Page, path ...string) []byte
	SaveElementScreen(el *rod.Element, path ...string) []byte
	HookResource(page *rod.Page)
	StartWebPage(url string) *rod.Page
}

RodClient 定义统一接口

func UseRodTool

func UseRodTool(options ...func(*option)) RodClient

Jump to

Keyboard shortcuts

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