Documentation ¶
Overview ¶
Package parser is a generated protocol buffer package.
It is generated from these files:
parser.proto
It has these top-level messages:
ParseRequest ParseReply
Index ¶
- Constants
- Variables
- func DecodePassword(p string, privateKey *rsa.PrivateKey) string
- func GenerateRSAKey() (*rsa.PrivateKey, error)
- func LoadDownloads(fs []string)
- func PKCS1Pad2Encrypt(s []byte, pub *rsa.PublicKey) (string, error)
- func ParseFile(fn string) error
- func PostDataToSlack(msg, channel string) bool
- func PrivateKeyString(key *rsa.PrivateKey) []byte
- func PublicKeyString(key *rsa.PublicKey) []byte
- func RegisterParserServer(s *grpc.Server, srv ParserServer)
- func UploadImage(path string) string
- type Analyzer
- type CasperCmd
- func (self *CasperCmd) Close() bool
- func (self *CasperCmd) Finished() bool
- func (self *CasperCmd) GetArgsValue(key string) string
- func (self *CasperCmd) GetId() string
- func (self *CasperCmd) GetMessage() *Output
- func (self *CasperCmd) GetParseReq(fetchStatus string) *ParseRequest
- func (self *CasperCmd) SetInputArgs(input map[string]string)
- func (self *CasperCmd) Successed() bool
- type CasperCmdFactory
- type CasperOutput
- type CasperServer
- type Command
- type CommandCache
- type CommandFactory
- type Mail
- type Output
- type ParseReply
- type ParseRequest
- type ParseRequestType
- type ParserClient
- type ParserServer
Constants ¶
View Source
const ( PARAM_USERNAME = "username" PARAM_PASSWORD = "password" PARAM_PASSWORD2 = "password2" PARAM_VERIFY_CODE = "randcode" PARAM_PHONE_NUM = "phone" FAIL = "fail" NEED_PARAM = "need_param" NOT_SUPPORT = "not_support" WRONG_PASSWORD = "wrong_password" WRONG_VERIFYCODE = "wrong_verifycode" WRONG_SECOND_PASSWORD = "wrong_second_password" LOGIN_SUCCESS = "login_success" BEGIN_FETCH_DATA = "begin_fetch_data" FINISH_FETCH_DATA = "finish_fetch_data" FINISH_ALL = "finish_all" OUTPUT_PUBLICKEY = "output_publickey" OUTPUT_VERIFYCODE = "output_verifycode" TAOBAO_FAIL = "taobao_crawl_failed" )
Variables ¶
View Source
var ParseRequestType_name = map[int32]string{
0: "Eml",
1: "Html",
2: "Honeycomb",
3: "TaobaoShop",
}
View Source
var ParseRequestType_value = map[string]int32{
"Eml": 0,
"Html": 1,
"Honeycomb": 2,
"TaobaoShop": 3,
}
Functions ¶
func DecodePassword ¶
func DecodePassword(p string, privateKey *rsa.PrivateKey) string
func GenerateRSAKey ¶
func GenerateRSAKey() (*rsa.PrivateKey, error)
func LoadDownloads ¶
func LoadDownloads(fs []string)
func PostDataToSlack ¶
func PrivateKeyString ¶
func PrivateKeyString(key *rsa.PrivateKey) []byte
func PublicKeyString ¶
func RegisterParserServer ¶
func RegisterParserServer(s *grpc.Server, srv ParserServer)
func UploadImage ¶
Types ¶
type Analyzer ¶
type Analyzer struct { ServerList []string `json:"server_list"` // contains filtered or unexported fields }
func NewAnalyzer ¶
func (*Analyzer) ProcessZip ¶
func (p *Analyzer) ProcessZip(req *ParseRequest, body []byte) bool
func (*Analyzer) SendReq ¶
func (p *Analyzer) SendReq(req *ParseRequest) bool
type CasperCmd ¶
type CasperCmd struct {
// contains filtered or unexported fields
}
func (*CasperCmd) GetArgsValue ¶
func (*CasperCmd) GetMessage ¶
func (*CasperCmd) GetParseReq ¶
func (self *CasperCmd) GetParseReq(fetchStatus string) *ParseRequest
func (*CasperCmd) SetInputArgs ¶
type CasperCmdFactory ¶
type CasperCmdFactory struct{}
func (*CasperCmdFactory) CreateCommand ¶
func (s *CasperCmdFactory) CreateCommand(params url.Values, globalContext map[string]interface{}) Command
func (*CasperCmdFactory) CreateCommandWithPrivateKey ¶
func (s *CasperCmdFactory) CreateCommandWithPrivateKey(params url.Values, globalContext map[string]interface{}, pk *rsa.PrivateKey) Command
type CasperOutput ¶
type CasperServer ¶
type CasperServer struct {
// contains filtered or unexported fields
}
func NewCasperServer ¶
func NewCasperServer(cf CommandFactory) *CasperServer
func (*CasperServer) GetContext ¶
func (self *CasperServer) GetContext() map[string]interface{}
func (*CasperServer) ServeHTTP ¶
func (self *CasperServer) ServeHTTP(w http.ResponseWriter, req *http.Request)
type CommandCache ¶
type CommandCache struct {
// contains filtered or unexported fields
}
func NewCommandCache ¶
func NewCommandCache() *CommandCache
func (*CommandCache) Delete ¶
func (self *CommandCache) Delete(id string)
func (*CommandCache) GetCommand ¶
func (self *CommandCache) GetCommand(id string) Command
func (*CommandCache) SetCommand ¶
func (self *CommandCache) SetCommand(c Command)
type CommandFactory ¶
type ParseReply ¶
type ParseReply struct { ServerName string `protobuf:"bytes,1,opt" json:"ServerName,omitempty"` IsParsedSucced bool `protobuf:"varint,2,opt" json:"IsParsedSucced,omitempty"` WriteHbaseSucced bool `protobuf:"varint,3,opt" json:"WriteHbaseSucced,omitempty"` }
func (*ParseReply) ProtoMessage ¶
func (*ParseReply) ProtoMessage()
func (*ParseReply) Reset ¶
func (m *ParseReply) Reset()
func (*ParseReply) String ¶
func (m *ParseReply) String() string
type ParseRequest ¶
type ParseRequest struct { ClientName string `protobuf:"bytes,1,opt" json:"ClientName,omitempty"` Tmpl string `protobuf:"bytes,2,opt" json:"Tmpl,omitempty"` RowKey string `protobuf:"bytes,3,opt" json:"RowKey,omitempty"` UserName string `protobuf:"bytes,4,opt" json:"UserName,omitempty"` PublicKey string `protobuf:"bytes,5,opt" json:"PublicKey,omitempty"` PrivateKey string `protobuf:"bytes,6,opt" json:"PrivateKey,omitempty"` Secret string `protobuf:"bytes,7,opt" json:"Secret,omitempty"` IsZip bool `protobuf:"varint,8,opt" json:"IsZip,omitempty"` Data []string `protobuf:"bytes,9,rep" json:"Data,omitempty"` ParsedData string `protobuf:"bytes,10,opt" json:"ParsedData,omitempty"` ReqType ParseRequestType `protobuf:"varint,11,opt,enum=parser.ParseRequestType" json:"ReqType,omitempty"` FetchStatus string `protobuf:"bytes,12,opt" json:"FetchStatus,omitempty"` // DataMetaInfo is responsed for Data, DataMetaInfo[index] maps Data[index] DataMetaInfo []string `protobuf:"bytes,13,rep" json:"DataMetaInfo,omitempty"` }
func (*ParseRequest) ProtoMessage ¶
func (*ParseRequest) ProtoMessage()
func (*ParseRequest) Reset ¶
func (m *ParseRequest) Reset()
func (*ParseRequest) String ¶
func (m *ParseRequest) String() string
type ParseRequestType ¶
type ParseRequestType int32
const ( ParseRequestType_Eml ParseRequestType = 0 ParseRequestType_Html ParseRequestType = 1 ParseRequestType_Honeycomb ParseRequestType = 2 ParseRequestType_TaobaoShop ParseRequestType = 3 ParseRequestType_Honeycomb_Taobao ParseRequestType = 4 ParseRequestType_Honeycomb_Ccrc ParseRequestType = 5 ParseRequestType_Honeycomb_Phone ParseRequestType = 6 ParseRequestType_Default ParseRequestType = 7 )
func (ParseRequestType) String ¶
func (x ParseRequestType) String() string
type ParserClient ¶
type ParserClient interface { // Sends a parse request ProcessParseRequest(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseReply, error) }
func NewParserClient ¶
func NewParserClient(cc *grpc.ClientConn) ParserClient
type ParserServer ¶
type ParserServer interface { // Sends a parse request ProcessParseRequest(context.Context, *ParseRequest) (*ParseReply, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.