parser

package
v0.0.0-...-9c02f24 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ParseUrl is the url of the parser service
	ParseUrl = "http://127.0.0.1:2334/dataset/parser"

	// APIKeyHeader is API Key Header
	APIKeyHeader = "kanaries-api-key"
)
View Source
const (
	STRING   = "string"
	NUMBER   = "number"
	DATETIME = "datetime"
	BOOLEAN  = "bool"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(apiKey string) *Client

func (*Client) Parse

func (c *Client) Parse(dataset *Dataset, dsl string) (string, error)

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(httpClient *http.Client)

type Dataset

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

func NewDataset

func NewDataset(name string, fields map[string]Field, dialect string) *Dataset

type Field

type Field struct {
	Key  string `json:"key"`
	Fid  string `json:"fid"`
	Type string `json:"type"`
}

type ParseResponse

type ParseResponse struct {
	Data    string `json:"data"`
	Success bool   `json:"success"`
}

Jump to

Keyboard shortcuts

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