client

package
v0.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int

func Int(i int) *int

func String

func String(s string) *string

Types

type Client

type Client interface {
	CreateSearchJob(ctx context.Context, req *CreateSearchJobReq) (*CreateSearchJobRes, error)
	GetSearchJobByID(ctx context.Context, req *GetSearchJobByIDReq) (*GetSearchJobByIDRes, error)
	GetSearchJobResults(ctx context.Context, req *GetSearchJobResultsReq) (*GetSearchJobResultsRes, error)
}

func New

func New(token, host, deployment string) Client

type CreateSearchJobReq

type CreateSearchJobReq struct {
	ID            string   `url:"id"`
	ExecMode      string   `url:"exec_mode"`
	Search        string   `url:"search"`
	StatusBuckets *int     `url:"status_buckets,omitempty"`
	MaxCount      *int     `url:"max_count,omitempty"`
	RF            []string `url:"rf,omitempty"`
	EarliestTime  *string  `url:"earliest_time,omitempty"`
	LatestTime    *string  `url:"latest_time,omitempty"`
}

type CreateSearchJobRes

type CreateSearchJobRes struct {
	Sid string `json:"sid"`
}

type DispatchState

type DispatchState string
const (
	DispatchStateQueued         DispatchState = "QUEUED"
	DispatchStateParsing        DispatchState = "PARSING"
	DispatchStateRunning        DispatchState = "RUNNING"
	DispatchStateFinalizing     DispatchState = "FINALIZING"
	DispatchStateDone           DispatchState = "DONE"
	DispatchStatePause          DispatchState = "PAUSE"
	DispatchStateInternalCancel DispatchState = "INTERNAL_CANCEL"
	DispatchStateUserCancel     DispatchState = "USER_CANCEL"
	DispatchStateBadInputCancel DispatchState = "BAD_INPUT_CANCEL"
	DispatchStateQuit           DispatchState = "QUIT"
	DispatchStateFailed         DispatchState = "FAILED"
)

func (DispatchState) Done

func (d DispatchState) Done() bool

func (DispatchState) Failed

func (d DispatchState) Failed() bool

func (DispatchState) Wait

func (d DispatchState) Wait() bool

type GetSearchJobByIDReq

type GetSearchJobByIDReq struct {
	ID string
}

type GetSearchJobByIDRes

type GetSearchJobByIDRes struct {
	DispatchState DispatchState `json:"dispatchState"`
}

type GetSearchJobResultsReq

type GetSearchJobResultsReq struct {
	ID         string `url:"-"`
	OutputMode string `url:"output_mode"`
}

type GetSearchJobResultsRes

type GetSearchJobResultsRes struct {
	Results []any `json:"results"`
}

Jump to

Keyboard shortcuts

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