Documentation ¶
Index ¶
- Constants
- func Debug(s string)
- func Debugf(s string, i ...interface{})
- func Error(s string)
- func Errorf(s string, i ...interface{})
- func Fatal(s string)
- func Fatalf(s string, i ...interface{})
- func GetAuthTokenStreamChainInterceptor() grpc.StreamClientInterceptor
- func GetAuthTokenUnaryChainInterceptor() grpc.UnaryClientInterceptor
- func GetClient(opts ...ClientOption) interfaces.Client
- func GetLogger(opts ...LoggerOption) interfaces.Logger
- func GetOssBucket() (bucket *oss.Bucket, err error)
- func GetResultService(opts ...ResultServiceOption) interfaces.ResultService
- func GetTaskId() (id primitive.ObjectID)
- func Info(s string)
- func Infof(s string, i ...interface{})
- func Log(s string)
- func Logf(s string, i ...interface{})
- func OssClientInit() error
- func OssVisitLink(ossPath string, expiredTs int64) (string, error)
- func SaveFileToOss(task entity.OssTask) error
- func SaveItem(items ...entity.Result) error
- func SaveItems(items []entity.Result)
- func Warn(s string)
- func Warnf(s string, i ...interface{})
- type Client
- func (c *Client) GetModelBaseServiceClient() grpc2.ModelBaseServiceClient
- func (c *Client) GetModelDelegateClient() grpc2.ModelDelegateClient
- func (c *Client) GetNodeClient() grpc2.NodeServiceClient
- func (c *Client) GetPluginClient() grpc2.PluginServiceClient
- func (c *Client) GetTaskClient() grpc2.TaskServiceClient
- type ClientOption
- type Logger
- func (l *Logger) Debug(s string)
- func (l *Logger) Debugf(s string, i ...interface{})
- func (l *Logger) Error(s string)
- func (l *Logger) Errorf(s string, i ...interface{})
- func (l *Logger) Fatal(s string)
- func (l *Logger) Fatalf(s string, i ...interface{})
- func (l *Logger) Info(s string)
- func (l *Logger) Infof(s string, i ...interface{})
- func (l *Logger) Log(s string)
- func (l *Logger) Logf(s string, i ...interface{})
- func (l *Logger) Warn(s string)
- func (l *Logger) Warnf(s string, i ...interface{})
- type LoggerOption
- type ResultService
- type ResultServiceOption
Constants ¶
View Source
const ( TaskIdEnv = "CRAWLAB_TASK_ID" GrpcAddressEnv = "CRAWLAB_GRPC_ADDRESS" GrpcAuthKeyEnv = "CRAWLAB_GRPC_AUTH_KEY" )
View Source
const ( LogLevelDebug = "DEBUG" LogLevelInfo = "INFO" LogLevelWarn = "WARN" LogLevelError = "ERROR" LogLevelFatal = "FATAL" )
View Source
const GrpcHeaderAuthorization = "authorization"
Variables ¶
This section is empty.
Functions ¶
func GetAuthTokenStreamChainInterceptor ¶
func GetAuthTokenStreamChainInterceptor() grpc.StreamClientInterceptor
func GetAuthTokenUnaryChainInterceptor ¶
func GetAuthTokenUnaryChainInterceptor() grpc.UnaryClientInterceptor
func GetClient ¶
func GetClient(opts ...ClientOption) interfaces.Client
func GetLogger ¶
func GetLogger(opts ...LoggerOption) interfaces.Logger
func GetOssBucket ¶
func GetResultService ¶
func GetResultService(opts ...ResultServiceOption) interfaces.ResultService
func OssClientInit ¶
func OssClientInit() error
func SaveFileToOss ¶
Types ¶
type Client ¶
type Client struct { // dependencies ModelDelegateClient grpc2.ModelDelegateClient ModelBaseServiceClient grpc2.ModelBaseServiceClient NodeClient grpc2.NodeServiceClient TaskClient grpc2.TaskServiceClient PluginClient grpc2.PluginServiceClient // contains filtered or unexported fields }
var C *Client
func (*Client) GetModelBaseServiceClient ¶
func (c *Client) GetModelBaseServiceClient() grpc2.ModelBaseServiceClient
func (*Client) GetModelDelegateClient ¶
func (c *Client) GetModelDelegateClient() grpc2.ModelDelegateClient
func (*Client) GetNodeClient ¶
func (c *Client) GetNodeClient() grpc2.NodeServiceClient
func (*Client) GetPluginClient ¶
func (c *Client) GetPluginClient() grpc2.PluginServiceClient
func (*Client) GetTaskClient ¶
func (c *Client) GetTaskClient() grpc2.TaskServiceClient
type ClientOption ¶
type ClientOption func(c interfaces.Client)
type LoggerOption ¶
type ResultService ¶
type ResultService struct {
// contains filtered or unexported fields
}
var RS *ResultService
func (*ResultService) SaveItems ¶
func (svc *ResultService) SaveItems(items []entity.Result)
type ResultServiceOption ¶
type ResultServiceOption func(svc interfaces.ResultService)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.