Documentation
¶
Index ¶
- func NewHeader(username, password string) http.Header
- type Client
- func (c *Client) CreateDashboard(d *Dashboard) error
- func (c *Client) CreateMaterializedView(v *MaterializedView) error
- func (c *Client) CreateSink(s *Sink) error
- func (c *Client) CreateSource(s *Source) error
- func (c *Client) CreateStream(s *Stream) error
- func (c *Client) CreateUDF(u *UDF) error
- func (c *Client) CreateView(v *View) error
- func (c *Client) DeleteDashboard(id string) error
- func (c *Client) DeleteMaterializedView(v *MaterializedView) error
- func (c *Client) DeleteSink(s *Sink) error
- func (c *Client) DeleteSource(s *Source) error
- func (c *Client) DeleteStream(s *Stream) error
- func (c *Client) DeleteUDF(name string) error
- func (c *Client) DeleteView(v *View) error
- func (c *Client) GetDashboard(id string) (Dashboard, error)
- func (c *Client) GetMaterializedView(name string) (v MaterializedView, err error)
- func (c *Client) GetSink(id string) (Sink, error)
- func (c *Client) GetSource(id string) (Source, error)
- func (c *Client) GetStream(name string) (Stream, error)
- func (c *Client) GetUDF(name string) (UDF, error)
- func (c *Client) GetView(name string) (v View, err error)
- func (c *Client) UpdateDashboard(s *Dashboard) error
- func (c *Client) UpdateMaterializedView(v *MaterializedView) error
- func (c *Client) UpdateSink(s *Sink) error
- func (c *Client) UpdateSource(s *Source) error
- func (c *Client) UpdateStream(s *Stream) error
- func (c *Client) UpdateUDF(u *UDF) error
- func (c *Client) UpdateView(v *View) error
- type ClientOptions
- type Column
- type Dashboard
- type MaterializedView
- type Panel
- type Sink
- type Source
- type Stream
- type StreamMode
- type UDF
- type UDFArgument
- type UDFAuthContext
- type UDFAuthMethod
- type UDFType
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
func (*Client) CreateDashboard ¶
func (*Client) CreateMaterializedView ¶
func (c *Client) CreateMaterializedView(v *MaterializedView) error
func (*Client) CreateSink ¶
func (*Client) CreateSource ¶
func (*Client) CreateStream ¶
func (*Client) CreateView ¶
func (*Client) DeleteDashboard ¶
func (*Client) DeleteMaterializedView ¶
func (c *Client) DeleteMaterializedView(v *MaterializedView) error
func (*Client) DeleteSink ¶
func (*Client) DeleteSource ¶
func (*Client) DeleteStream ¶
func (*Client) DeleteView ¶
func (*Client) GetMaterializedView ¶
func (c *Client) GetMaterializedView(name string) (v MaterializedView, err error)
func (*Client) UpdateDashboard ¶
func (*Client) UpdateMaterializedView ¶
func (c *Client) UpdateMaterializedView(v *MaterializedView) error
func (*Client) UpdateSink ¶
func (*Client) UpdateSource ¶
func (*Client) UpdateStream ¶
func (*Client) UpdateView ¶
type ClientOptions ¶
type ClientOptions struct {
BaseURL string
}
optional configurations for the client
func DefaultOptions ¶
func DefaultOptions() ClientOptions
type Column ¶
type Column struct {
Name string `json:"name" binding:"required" example:"name"`
Type string `json:"type" binding:"required" example:"string"`
Default string `json:"default,omitempty"`
Codec string `json:"codec"`
TTLExpression string `json:"ttl_expression,omitempty"`
SkippingIndexExpression string `json:"skipping_index_expression,omitempty"`
}
type MaterializedView ¶
type Panel ¶
type Panel struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
// e.g. {"x":0,"y":0,"w":6,"h":2,"nextX":6,"nextY":2}
Position map[string]any `json:"position"`
// e.g. `chart`, `markdown`
VizType string `json:"viz_type"`
// For chart, the viz_content is the SQL
// For markdown, the viz_content is the markdown itself
VizContent string `json:"viz_content"`
// The JSON configuration of the viz
// For chart, it is `{ "chart_type": "line", ... }`
// For markdown, it is `{ "favour": "github", ... }`
VizConfig map[string]any `json:"viz_config"`
}
type Sink ¶
type Sink struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Query string `json:"query"`
// Additional configurations such as broker url and etc. should be passed through `properties`
Type string `json:"type"`
// Additional properties that required to write the data to the sink (e.g. broker url). Please refer to the sinks documentation
Properties map[string]any `json:"properties"`
}
type Stream ¶
type Stream struct {
// Stream name should only contain a maximum of 64 letters, numbers, or _, and start with a letter
Name string `json:"name"`
Description string `json:"description"`
Columns []Column `json:"columns"`
// This column will be used as the event time if specified
EventTimeColumn string `json:"event_time_column,omitempty"`
// The timezone of the `EventTimeColumn`
TimestampTimezone string `json:"event_time_timezone"`
Shards int `json:"shards,omitempty"`
ReplicationFactor int `json:"replication_factor,omitempty"`
OrderByExpression string `json:"order_by_expression,omitempty"`
OrderByGranularity string `json:"order_by_granularity,omitempty"`
PartitionByGranularity string `json:"partition_by_granularity,omitempty"`
HistoricalTTLExpression string `json:"ttl_expression,omitempty"` // API request
TTL string `json:"ttl"` // API response
// Default to `append`.
Mode string `json:"mode,omitempty"`
// Expression of primary key, required in `changelog_kv` and `versioned_kv` mode
PrimaryKey string `json:"primary_key,omitempty"`
// The max size a stream can grow. Any non-positive value means unlimited size. Default to 10 GiB.
RetentionBytes int `json:"logstore_retention_bytes,omitempty" example:"10737418240"`
// The max time the data can be retained in the stream. Any non-positive value means unlimited time. Default to 7 days.
RetentionMS int `json:"logstore_retention_ms,omitempty" example:"604800000"`
}
type StreamMode ¶
type StreamMode string
const ( StreamModeAppend StreamMode = "append" StreamModeChangeLog StreamMode = "changelog" StreamModeChangeLogKV StreamMode = "changelog_kv" StreamModeVersionedKV StreamMode = "versioned_kv" )
func StreamModeFrom ¶ added in v0.1.3
func StreamModeFrom(s string) (StreamMode, error)
type UDF ¶
type UDF struct {
Name string `json:"name"`
Description string `json:"description"`
Type UDFType `json:"type"`
// The input argument of the UDF, the type should be Timeplus data types, not javascript types.
// Only int8/16/32/64, uint8/16/32/64 are supported.
Arguments []UDFArgument `json:"arguments"`
// The erturn type of the UDF
// * For UDA: if it returns a single value, the return type is the corresponding data type of Timeplus.
// It supports the same types of input arguments, except for datetime, it only supports DateTime64(3).
ReturnType string `json:"return_type" example:"float64"`
// Only valid when `type` is `remote`.
URL string `json:"url,omitempty"`
// Only valid when `type` is `remote`.
// This field is used to set the authentication method for remote UDF. It can be either `auth_header` or `none`.
// When `auth_header` is set, you can configure `auth_context` to specify the HTTP header that be sent the remote URL
AuthMethod UDFAuthMethod `json:"auth_method,omitempty"`
// Only valid when `type` is `remote` and `auth_method` is `auth_header`
AuthContext *UDFAuthContext `json:"auth_context,omitempty"`
// Only valid when type is 'javascript'. Whether it is an aggregation function.
IsAggrFunction bool `json:"is_aggregation,omitempty"`
Source string `json:"source,omitempty"`
}
type UDFArgument ¶
type UDFAuthContext ¶
type UDFAuthMethod ¶
type UDFAuthMethod string
const ( UDFAuthHeader UDFAuthMethod = "auth_header" UDFAuthNone UDFAuthMethod = "none" )
Click to show internal directories.
Click to hide internal directories.