package harness
import "github.com/datastax/astra-db-go/v2/integration/harness"
Index
- Constants
- Variables
- func APIEndpoint() string
- func ApplicationToken() string
- func Backend() options.Environment
- func Bold(msg string) string
- func EmbeddingApiKey() string
- func Faint(msg string) string
- func FprintlnChecklist(w io.Writer, msg string)
- func FprintlnNestedChecklist(w io.Writer, msg string)
- func Highlight(msg string) string
- func Init()
- func PrintlnBold(msg string)
- func PrintlnChecklist(msg string)
- func PrintlnNestedChecklist(msg string)
- func Run() (int, bool)
- type EverythingDoc
- type EverythingDocInner
- type EverythingRow
- type EverythingRowWithVectorize
- type ExampleUDT
-
type S
- func BackgroundSuite() *S
- func ParallelSuite(name string) *S
- func SequentialSuite(name string) *S
- func (s *S) After(fn func(*T)) *S
- func (s *S) Before(fn func(*T)) *S
- func (s *S) Drop(tOrC tOrCSelect, bOrA bOrASelect)
- func (s *S) Run(name string, fn func(*T)) *S
- func (s *S) Truncate(tOrC tOrCSelect, bOrA bOrASelect)
- type T
- type TestObjects
Constants
const ( DefaultCollectionName = "test_coll_go" DefaultTableName = "test_table_go" DefaultUDTName = "example_udt" )
const ( SelectCollections tOrCSelect = 1 << iota SelectTables )
const ( SelectBefore bOrASelect = 1 << iota SelectAfter )
Variables
var Ctx = context.Background()
var EverythingTableSchema = must(table.Infer[EverythingRow]())
var EverythingTableSchemaWithVectorize = must(table.Infer[EverythingRowWithVectorize]( table.NewDefinition(). AddVectorColumnWithService("vector1", 1024, &table.VectorService{ Provider: "openai", ModelName: "text-embedding-3-small", }). AddVectorColumnWithService("vector2", 1024, &table.VectorService{ Provider: "openai", ModelName: "text-embedding-3-small", }), ))
var ExampleUDTSchema = must(table.InferUDT[ExampleUDT]())
var TestKeyspaces = []string{"default_keyspace", "other_keyspace"}
var TestsDirectory string
Functions
func APIEndpoint
func APIEndpoint() string
func ApplicationToken
func ApplicationToken() string
func Backend
func Backend() options.Environment
func Bold
func Bold(msg string) string
func EmbeddingApiKey
func EmbeddingApiKey() string
func Faint
func Faint(msg string) string
func FprintlnChecklist
func FprintlnChecklist(w io.Writer, msg string)
func FprintlnNestedChecklist
func FprintlnNestedChecklist(w io.Writer, msg string)
func Highlight
func Highlight(msg string) string
func Init
func Init()
func PrintlnBold
func PrintlnBold(msg string)
func PrintlnChecklist
func PrintlnChecklist(msg string)
func PrintlnNestedChecklist
func PrintlnNestedChecklist(msg string)
func Run
func Run() (int, bool)
Types
type EverythingDoc
type EverythingDoc struct { ID datatypes.UUID `json:"_id,omitempty"` Vector datatypes.Vector `json:"$vector,omitempty"` Nested EverythingDocInner `json:"nested"` }
type EverythingDocInner
type EverythingDocInner struct { UUID datatypes.UUID `json:"uuid"` ObjectId datatypes.ObjectId `json:"objectid"` Date time.Time `json:"date"` Big *big.Int `json:"big"` }
type EverythingRow
type EverythingRow struct { Ascii string `json:"ascii" astra:"type=ascii"` BigInt int64 `json:"bigint"` Blob []byte `json:"blob"` Boolean bool `json:"boolean"` Date datatypes.DateOnly `json:"date"` Decimal *big.Float `json:"decimal"` Double float64 `json:"double"` Duration datatypes.Duration `json:"duration"` Float float32 `json:"float"` Int int `json:"int" astra:"ck"` Inet net.IP `json:"inet"` SmallInt int16 `json:"smallint"` Text string `json:"text" astra:"pk"` Time datatypes.TimeOnly `json:"time"` Timestamp time.Time `json:"timestamp"` TinyInt int8 `json:"tinyint"` UUID datatypes.UUID `json:"uuid"` Varint *big.Int `json:"varint"` Vector datatypes.Vector `json:"vector" astra:"dim=5"` Map map[int64]map[string]any `json:"map" astra:"type=map[bigint]udt[example_udt]"` Set []datatypes.UUID `json:"set" astra:"type=set"` List []map[string]any `json:"list" astra:"type=list[udt[example_udt]]"` UDT any `json:"udt" astra:"type=udt[example_udt]"` }
type EverythingRowWithVectorize
type EverythingRowWithVectorize struct { Ascii string `json:"ascii" astra:"type=ascii"` BigInt int64 `json:"bigint"` Blob []byte `json:"blob"` Boolean bool `json:"boolean"` Date datatypes.DateOnly `json:"date"` Decimal *big.Float `json:"decimal"` Double float64 `json:"double"` Duration datatypes.Duration `json:"duration"` Float float32 `json:"float"` Int int `json:"int" astra:"ck"` Inet net.IP `json:"inet"` SmallInt int16 `json:"smallint"` Text string `json:"text" astra:"pk"` Time datatypes.TimeOnly `json:"time"` Timestamp time.Time `json:"timestamp"` TinyInt int8 `json:"tinyint"` UUID datatypes.UUID `json:"uuid"` Varint *big.Int `json:"varint"` Vector1 string `json:"vector1"` Vector2 string `json:"vector2"` Map map[int64]map[string]any `json:"map" astra:"type=map[bigint]udt[example_udt]"` Set []datatypes.UUID `json:"set" astra:"type=set"` List []map[string]any `json:"list" astra:"type=list[udt[example_udt]]"` UDT any `json:"udt" astra:"type=udt[example_udt]"` }
type ExampleUDT
type ExampleUDT struct { Name string `json:"name"` Age *big.Int `json:"age"` ID datatypes.UUID `json:"id"` }
type S
type S struct { Name string Type suiteType // contains filtered or unexported fields }
func BackgroundSuite
func BackgroundSuite() *S
func ParallelSuite
func ParallelSuite(name string) *S
func SequentialSuite
func SequentialSuite(name string) *S
func (*S) After
func (s *S) After(fn func(*T)) *S
func (*S) Before
func (s *S) Before(fn func(*T)) *S
func (*S) Drop
func (s *S) Drop(tOrC tOrCSelect, bOrA bOrASelect)
func (*S) Run
func (s *S) Run(name string, fn func(*T)) *S
func (*S) Truncate
func (s *S) Truncate(tOrC tOrCSelect, bOrA bOrASelect)
type T
type T struct { *TestObjects Name string Ctx context.Context // contains filtered or unexported fields }
T contains all test-spec data and utilities, similar to testing.T
func (*T) Fatalf
func (t *T) Fatalf(format string, args ...any)
func (*T) Helper
func (t *T) Helper()
Helper marks the calling function as a test helper function. When printing file and line information, that function will be skipped.
func (*T) Key
func (t *T) Key(seed int) string
func (*T) Log
func (t *T) Log(items ...any)
func (*T) Logf
func (t *T) Logf(format string, args ...any)
func (*T) NoDiff
func (t *T) NoDiff(want, got any)
type TestObjects
type TestObjects struct { Client *astra.DataAPIClient Db *astra.Db Collection *astra.Collection Collection_ *astra.Collection DbAdmin astra.DatabaseAdmin Table *astra.Table Table_ *astra.Table Admin *astra.AstraAdmin }
var GlobalFixtures *TestObjects
func NewMemoizedTestObjects
func NewMemoizedTestObjects() *TestObjects
func NewTestObjects
func NewTestObjects() *TestObjects