Documentation ¶
Index ¶
- func Closest(req index.Request) ([]byte, []byte)
- func ClosestWithPrefix(req index.Request, prefix string) ([]byte, []byte)
- func Key(key string) []byte
- func KeyWithPrefix(key string, prefix string) []byte
- func MarshalCdx(r index.Record) (key []byte, value []byte, err error)
- func MarshalCdxWithPrefix(r index.Record, prefix string) (key []byte, value []byte, err error)
- func MarshalFileInfo(fileInfo *schema.FileInfo, prefix string) (key []byte, value []byte, err error)
- func MarshalId(r index.Record, prefix string) (key []byte, value []byte, err error)
- func MarshalReport(report *schema.Report, prefix string) (key []byte, value []byte, err error)
- func SearchKey(req index.Request) []byte
- func SearchKeyWithPrefix(req index.Request, prefix string) []byte
- func SplitSSURT(ssurt string) (surtHost string, portSchemeUserInfo string, path string)
- type CdxKey
- func (ck CdxKey) Domain() string
- func (ck CdxKey) Path() string
- func (ck CdxKey) Port() string
- func (ck CdxKey) PortSchemeUserInfo() string
- func (ck CdxKey) ResponseType() string
- func (ck CdxKey) Scheme() string
- func (ck CdxKey) String() string
- func (ck CdxKey) Time() time.Time
- func (ck CdxKey) Unix() int64
- func (ck CdxKey) UserInfo() string
- type CdxResponse
- type DebugAPI
- type DebugRequest
- type FileInfoResponse
- type IdResponse
- type ReportGenerator
- type ReportResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyWithPrefix ¶
func MarshalCdxWithPrefix ¶
MarshalCdxWithPrefix takes a record and returns a key-value pair for the cdx index.
func MarshalFileInfo ¶
func MarshalFileInfo(fileInfo *schema.FileInfo, prefix string) (key []byte, value []byte, err error)
MarshalFileInfo takes a fileinfo and returns a key-value pair for the file index.
func MarshalReport ¶
MarshalReport takes a report and returns a key-value pair for the report index.
Types ¶
type CdxKey ¶
type CdxKey []byte
CdxKey is a wrapper around the key used in the cdx index The key consists of the following parts separated by a space character: 1. surt domain and path (<surt domain>/<path>) 2. timestamp (14 digits) 3. port, scheme and userinfo (port:scheme@userinfo:) 4. response type (response)
Example:
test,example,/path 20200101000000 8080:http@user:password: response
func (CdxKey) PortSchemeUserInfo ¶
func (CdxKey) ResponseType ¶
type CdxResponse ¶
CdxResponse implements the index.CdxResponse interface.
func (CdxResponse) GetCdx ¶
func (cr CdxResponse) GetCdx() *schema.Cdx
func (CdxResponse) GetError ¶
func (cr CdxResponse) GetError() error
func (CdxResponse) GetKey ¶
func (cr CdxResponse) GetKey() CdxKey
func (CdxResponse) MarshalJSON ¶
func (cr CdxResponse) MarshalJSON() ([]byte, error)
type DebugAPI ¶
type DebugAPI interface {
Debug(context.Context, DebugRequest, chan<- CdxResponse) error
}
type DebugRequest ¶
type FileInfoResponse ¶
FileInfoResponse implements the index.FileInfoResponse interface.
func (FileInfoResponse) GetError ¶
func (fir FileInfoResponse) GetError() error
func (FileInfoResponse) GetFileInfo ¶
func (fir FileInfoResponse) GetFileInfo() *schema.FileInfo
type IdResponse ¶
IdResponse implements the index.IdResponse interface.
func (IdResponse) GetError ¶
func (ir IdResponse) GetError() error
func (IdResponse) GetId ¶
func (ir IdResponse) GetId() string
func (IdResponse) GetValue ¶
func (ir IdResponse) GetValue() string
type ReportGenerator ¶
type ReportGenerator struct { Id string UpdateInterval time.Duration UpdateThreshold int index.ReportGenerator }
func NewReportGenerator ¶
func NewReportGenerator(g index.ReportGenerator) (*ReportGenerator, error)
type ReportResponse ¶
ReportResponse implements the index.ReportResponse interface.
func (ReportResponse) GetError ¶
func (rr ReportResponse) GetError() error
func (ReportResponse) GetReport ¶
func (rr ReportResponse) GetReport() *schema.Report