Documentation
¶
Index ¶
- Constants
- Variables
- func BulkDeleteSync(ctx context.Context, ids []string, refresh string, ...) error
- func BulkIndexSync(ctx context.Context, docs []Document, refresh string, ...) error
- func EnsureIndex(client *v8.Client) error
- func GetClient() (*v8.Client, error)
- func IndexSync(ctx context.Context, docs []Document, refresh string) error
- func Initialize(indexName, refresh string, addresses []string, numWorkers, flushBytes int, ...) error
- func InitializeWithClients(indexName string, client *v8.Client, bulkIndexer esutil.BulkIndexer) error
- func InitializeWithConfigs(indexName string, clientConfig *v8.Config, ...) error
- func InitializeWithDefaults(addresses []string) error
- func QueueBulkIndexItem(ctx context.Context, id, action string, body []byte, ...) error
- func QueueDocForDeletion(ctx context.Context, doc Document, ...) error
- func QueueDocForIndexing(ctx context.Context, doc Document, ...) error
- func QueueDocsForDeletion(ctx context.Context, docs []Document, ...) error
- func QueueDocsForIndexing(ctx context.Context, docs []Document, ...) error
- type AnEnumType
- type Document
- type Metadata
- type Thing
- func (s *Thing) Delete(ctx context.Context, refresh string) error
- func (s *Thing) DeleteWithRefresh(ctx context.Context) error
- func (*Thing) Descriptor() ([]byte, []int)deprecated
- func (x *Thing) GetABool() bool
- func (x *Thing) GetABytes() []byte
- func (x *Thing) GetADouble() float64
- func (x *Thing) GetAFloat() float32
- func (x *Thing) GetAString() string
- func (x *Thing) GetAStructField() *structpb.Struct
- func (x *Thing) GetATimestamp() *timestamppb.Timestamp
- func (x *Thing) GetAnEnum() AnEnumType
- func (x *Thing) GetAnIgnoredField() string
- func (x *Thing) GetAnInt32() int32
- func (x *Thing) GetAnInt64() int64
- func (x *Thing) GetAnOptionalInt() int32
- func (x *Thing) GetAssociatedThing() *Thing2
- func (x *Thing) GetAssociatedThingWithCascadeDelete() *Thing2
- func (x *Thing) GetId() string
- func (x *Thing) GetOptionalAssociatedThing() *Thing2
- func (x *Thing) GetOptionalScalarField() string
- func (x *Thing) GetOptionalTimestamp() *timestamppb.Timestamp
- func (x *Thing) GetRepeatedInt32() []int32
- func (x *Thing) GetRepeatedMessages() []*Thing2
- func (x *Thing) GetRepeatedScalarField() []string
- func (s *Thing) IndexAsync(ctx context.Context, ...) error
- func (s *Thing) IndexSync(ctx context.Context, refresh string) error
- func (s *Thing) IndexSyncWithRefresh(ctx context.Context) error
- func (msg *Thing) MarshalJSON() ([]byte, error)
- func (*Thing) ProtoMessage()
- func (x *Thing) ProtoReflect() protoreflect.Message
- func (x *Thing) Reset()
- func (x *Thing) String() string
- func (s *Thing) ToEsDocuments() ([]Document, error)
- func (msg *Thing) UnmarshalJSON(b []byte) error
- type Thing2
- func (s *Thing2) Delete(ctx context.Context, refresh string) error
- func (s *Thing2) DeleteRelatedDocumentsBulk(ctx context.Context, ...) error
- func (s *Thing2) DeleteWithRefresh(ctx context.Context) error
- func (*Thing2) Descriptor() ([]byte, []int)deprecated
- func (x *Thing2) GetId() string
- func (x *Thing2) GetName() string
- func (s *Thing2) IndexAsync(ctx context.Context, ...) error
- func (s *Thing2) IndexSync(ctx context.Context, refresh string) error
- func (s *Thing2) IndexSyncWithRefresh(ctx context.Context) error
- func (msg *Thing2) MarshalJSON() ([]byte, error)
- func (*Thing2) ProtoMessage()
- func (x *Thing2) ProtoReflect() protoreflect.Message
- func (s *Thing2) ReindexRelatedDocumentsAfterDeleteBulk(ctx context.Context, ...) error
- func (s *Thing2) ReindexRelatedDocumentsBulk(ctx context.Context, ...) error
- func (x *Thing2) Reset()
- func (x *Thing2) String() string
- func (s *Thing2) ToEsDocuments() ([]Document, error)
- func (msg *Thing2) UnmarshalJSON(b []byte) error
- type Thing2BulkEsModel
- func (s *Thing2BulkEsModel) Delete(ctx context.Context, refresh string, ...) error
- func (s *Thing2BulkEsModel) DeleteWithRefresh(ctx context.Context, ...) error
- func (s *Thing2BulkEsModel) IndexAsync(ctx context.Context, ...) error
- func (s *Thing2BulkEsModel) IndexSync(ctx context.Context, refresh string, ...) error
- func (s *Thing2BulkEsModel) IndexSyncWithRefresh(ctx context.Context, ...) error
- func (s *Thing2BulkEsModel) ToEsDocuments() ([]Document, error)
- type ThingBulkEsModel
- func (s *ThingBulkEsModel) Delete(ctx context.Context, refresh string, ...) error
- func (s *ThingBulkEsModel) DeleteWithRefresh(ctx context.Context, ...) error
- func (s *ThingBulkEsModel) IndexAsync(ctx context.Context, ...) error
- func (s *ThingBulkEsModel) IndexSync(ctx context.Context, refresh string, ...) error
- func (s *ThingBulkEsModel) IndexSyncWithRefresh(ctx context.Context, ...) error
- func (s *ThingBulkEsModel) ToEsDocuments() ([]Document, error)
Constants ¶
View Source
const Thing2EsType = "Thing2"
View Source
const ThingEsType = "Thing"
Variables ¶
View Source
var ( AnEnumType_name = map[int32]string{ 0: "AN_ENUM_UNSPECIFIED", 1: "AN_ENUM_ALPHA", 2: "AN_ENUM_BRAVO", } AnEnumType_value = map[string]int32{ "AN_ENUM_UNSPECIFIED": 0, "AN_ENUM_ALPHA": 1, "AN_ENUM_BRAVO": 2, } )
Enum value maps for AnEnumType.
View Source
var ElasticsearchBulkIndexer esutil.BulkIndexer
View Source
var ElasticsearchClient *v8.Client
View Source
var ElasticsearchIndexName string
View Source
var File_example_proto protoreflect.FileDescriptor
Functions ¶
func BulkDeleteSync ¶ added in v0.2.0
func BulkDeleteSync(ctx context.Context, ids []string, refresh string, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func BulkIndexSync ¶ added in v0.2.0
func BulkIndexSync(ctx context.Context, docs []Document, refresh string, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func EnsureIndex ¶
func Initialize ¶ added in v0.1.3
func InitializeWithClients ¶ added in v0.1.3
func InitializeWithConfigs ¶ added in v0.1.3
func InitializeWithDefaults ¶ added in v0.1.3
func QueueBulkIndexItem ¶
func QueueBulkIndexItem(ctx context.Context, id, action string, body []byte, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func QueueDocForDeletion ¶
func QueueDocForDeletion(ctx context.Context, doc Document, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func QueueDocForIndexing ¶
func QueueDocForIndexing(ctx context.Context, doc Document, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func QueueDocsForDeletion ¶
func QueueDocsForDeletion(ctx context.Context, docs []Document, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func QueueDocsForIndexing ¶
func QueueDocsForIndexing(ctx context.Context, docs []Document, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
Types ¶
type AnEnumType ¶
type AnEnumType int32
const ( AnEnumType_AN_ENUM_UNSPECIFIED AnEnumType = 0 AnEnumType_AN_ENUM_ALPHA AnEnumType = 1 AnEnumType_AN_ENUM_BRAVO AnEnumType = 2 )
func (AnEnumType) Descriptor ¶
func (AnEnumType) Descriptor() protoreflect.EnumDescriptor
func (AnEnumType) Enum ¶
func (x AnEnumType) Enum() *AnEnumType
func (AnEnumType) EnumDescriptor
deprecated
func (AnEnumType) EnumDescriptor() ([]byte, []int)
Deprecated: Use AnEnumType.Descriptor instead.
func (AnEnumType) Number ¶
func (x AnEnumType) Number() protoreflect.EnumNumber
func (AnEnumType) String ¶
func (x AnEnumType) String() string
func (AnEnumType) Type ¶
func (AnEnumType) Type() protoreflect.EnumType
type Metadata ¶
type Metadata struct { Key *string `json:"key,omitempty"` KeywordValue *string `json:"keywordValue,omitempty"` StringValue *string `json:"stringValue,omitempty"` LongValue *int64 `json:"longValue,omitempty"` DoubleValue *float64 `json:"doubleValue,omitempty"` DateValue *int64 `json:"dateValue,omitempty"` BoolValue *bool `json:"boolValue,omitempty"` }
type Thing ¶
type Thing struct { // @gotags: fake:"{uuid}" Id *string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty" fake:"{uuid}"` // @gotags: fake:"{price:0.00,1000.00}" ADouble float64 `protobuf:"fixed64,2,opt,name=a_double,json=aDouble,proto3" json:"a_double,omitempty" fake:"{price:0.00,1000.00}"` // @gotags: fake:"{price:0.00,1000.00}" AFloat float32 `protobuf:"fixed32,3,opt,name=a_float,json=aFloat,proto3" json:"a_float,omitempty" fake:"{price:0.00,1000.00}"` // @gotags: fake:"{int32}" AnInt32 int32 `protobuf:"varint,4,opt,name=an_int32,json=anInt32,proto3" json:"an_int32,omitempty" fake:"{int32}"` // @gotags: fake:"{int64}" AnInt64 int64 `protobuf:"varint,5,opt,name=an_int64,json=anInt64,proto3" json:"an_int64,omitempty" fake:"{int64}"` // @gotags: fake:"{bool}" ABool bool `protobuf:"varint,14,opt,name=a_bool,json=aBool,proto3" json:"a_bool,omitempty" fake:"{bool}"` // @gotags: fake:"{hackerphrase}" AString string `protobuf:"bytes,15,opt,name=a_string,json=aString,proto3" json:"a_string,omitempty" fake:"{hackerphrase}"` // @gotags: fake:"skip" ABytes []byte `protobuf:"bytes,16,opt,name=a_bytes,json=aBytes,proto3" json:"a_bytes,omitempty" fake:"skip"` // @gotags: fake:"{hackerphrase}" RepeatedScalarField []string `` /* 143-byte string literal not displayed */ // @gotags: fake:"skip" OptionalScalarField *string `` /* 139-byte string literal not displayed */ // @gotags: fake:"skip" AssociatedThing *Thing2 `protobuf:"bytes,19,opt,name=associated_thing,json=associatedThing,proto3" json:"associated_thing,omitempty" fake:"skip"` // @gotags: fake:"skip" OptionalAssociatedThing *Thing2 `` /* 151-byte string literal not displayed */ // @gotags: fake:"skip" RepeatedMessages []*Thing2 `protobuf:"bytes,21,rep,name=repeated_messages,json=repeatedMessages,proto3" json:"repeated_messages,omitempty" fake:"skip"` // @gotags: fake:"skip" ATimestamp *timestamppb.Timestamp `protobuf:"bytes,22,opt,name=a_timestamp,json=aTimestamp,proto3" json:"a_timestamp,omitempty" fake:"skip"` // @gotags: fake:"skip" AnIgnoredField string `protobuf:"bytes,23,opt,name=an_ignored_field,json=anIgnoredField,proto3" json:"an_ignored_field,omitempty" fake:"skip"` // @gotags: fake:"skip" AStructField *structpb.Struct `protobuf:"bytes,24,opt,name=a_struct_field,json=aStructField,proto3" json:"a_struct_field,omitempty" fake:"skip"` // @gotags: fake:"{number:1,2}" AnEnum AnEnumType `protobuf:"varint,25,opt,name=an_enum,json=anEnum,proto3,enum=test.AnEnumType" json:"an_enum,omitempty" fake:"{number:1,2}"` // @gotags: fake:"{number: 100,1000}" AnOptionalInt *int32 `` /* 136-byte string literal not displayed */ // @gotags: fake:"skip" OptionalTimestamp *timestamppb.Timestamp `` /* 131-byte string literal not displayed */ // @gotags: fake:"{int32}" RepeatedInt32 []int32 `protobuf:"varint,28,rep,packed,name=repeated_int32,json=repeatedInt32,proto3" json:"repeated_int32,omitempty" fake:"{int32}"` // @gotags: fake:"skip" AssociatedThingWithCascadeDelete *Thing2 `` /* 176-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Thing) DeleteWithRefresh ¶ added in v0.1.3
func (*Thing) Descriptor
deprecated
func (*Thing) GetADouble ¶
func (*Thing) GetAString ¶
func (*Thing) GetAStructField ¶
func (*Thing) GetATimestamp ¶
func (x *Thing) GetATimestamp() *timestamppb.Timestamp
func (*Thing) GetAnEnum ¶
func (x *Thing) GetAnEnum() AnEnumType
func (*Thing) GetAnIgnoredField ¶
func (*Thing) GetAnInt32 ¶
func (*Thing) GetAnInt64 ¶
func (*Thing) GetAnOptionalInt ¶
func (*Thing) GetAssociatedThing ¶
func (*Thing) GetAssociatedThingWithCascadeDelete ¶ added in v0.3.0
func (*Thing) GetOptionalAssociatedThing ¶
func (*Thing) GetOptionalScalarField ¶
func (*Thing) GetOptionalTimestamp ¶
func (x *Thing) GetOptionalTimestamp() *timestamppb.Timestamp
func (*Thing) GetRepeatedInt32 ¶
func (*Thing) GetRepeatedMessages ¶
func (*Thing) GetRepeatedScalarField ¶
func (*Thing) IndexAsync ¶
func (s *Thing) IndexAsync(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*Thing) IndexSyncWithRefresh ¶
func (*Thing) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Thing) ProtoMessage ¶
func (*Thing) ProtoMessage()
func (*Thing) ProtoReflect ¶
func (x *Thing) ProtoReflect() protoreflect.Message
func (*Thing) ToEsDocuments ¶
func (*Thing) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type Thing2 ¶
type Thing2 struct { // @gotags: fake:"{uuid}" Id *string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty" fake:"{uuid}"` // @gotags: fake:"{name}" Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" fake:"{name}"` // contains filtered or unexported fields }
func (*Thing2) DeleteRelatedDocumentsBulk ¶ added in v0.6.0
func (s *Thing2) DeleteRelatedDocumentsBulk(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error), bulkIndexer esutil.BulkIndexer) error
func (*Thing2) DeleteWithRefresh ¶ added in v0.1.3
func (*Thing2) Descriptor
deprecated
func (*Thing2) IndexAsync ¶
func (s *Thing2) IndexAsync(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*Thing2) IndexSyncWithRefresh ¶
func (*Thing2) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Thing2) ProtoMessage ¶
func (*Thing2) ProtoMessage()
func (*Thing2) ProtoReflect ¶
func (x *Thing2) ProtoReflect() protoreflect.Message
func (*Thing2) ReindexRelatedDocumentsAfterDeleteBulk ¶ added in v0.5.0
func (s *Thing2) ReindexRelatedDocumentsAfterDeleteBulk(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error), bulkIndexer esutil.BulkIndexer) error
func (*Thing2) ReindexRelatedDocumentsBulk ¶ added in v0.5.0
func (s *Thing2) ReindexRelatedDocumentsBulk(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error), bulkIndexer esutil.BulkIndexer) error
func (*Thing2) ToEsDocuments ¶
func (*Thing2) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type Thing2BulkEsModel ¶ added in v0.2.0
type Thing2BulkEsModel []*Thing2
func (*Thing2BulkEsModel) Delete ¶ added in v0.2.0
func (s *Thing2BulkEsModel) Delete(ctx context.Context, refresh string, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*Thing2BulkEsModel) DeleteWithRefresh ¶ added in v0.2.0
func (s *Thing2BulkEsModel) DeleteWithRefresh(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*Thing2BulkEsModel) IndexAsync ¶ added in v0.2.0
func (s *Thing2BulkEsModel) IndexAsync(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*Thing2BulkEsModel) IndexSync ¶ added in v0.2.0
func (s *Thing2BulkEsModel) IndexSync(ctx context.Context, refresh string, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*Thing2BulkEsModel) IndexSyncWithRefresh ¶ added in v0.2.0
func (s *Thing2BulkEsModel) IndexSyncWithRefresh(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*Thing2BulkEsModel) ToEsDocuments ¶ added in v0.2.0
func (s *Thing2BulkEsModel) ToEsDocuments() ([]Document, error)
type ThingBulkEsModel ¶ added in v0.2.0
type ThingBulkEsModel []*Thing
func (*ThingBulkEsModel) Delete ¶ added in v0.2.0
func (s *ThingBulkEsModel) Delete(ctx context.Context, refresh string, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*ThingBulkEsModel) DeleteWithRefresh ¶ added in v0.2.0
func (s *ThingBulkEsModel) DeleteWithRefresh(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*ThingBulkEsModel) IndexAsync ¶ added in v0.2.0
func (s *ThingBulkEsModel) IndexAsync(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*ThingBulkEsModel) IndexSync ¶ added in v0.2.0
func (s *ThingBulkEsModel) IndexSync(ctx context.Context, refresh string, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*ThingBulkEsModel) IndexSyncWithRefresh ¶ added in v0.2.0
func (s *ThingBulkEsModel) IndexSyncWithRefresh(ctx context.Context, onSuccess func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem), onFailure func(ctx context.Context, item esutil.BulkIndexerItem, item2 esutil.BulkIndexerResponseItem, err error)) error
func (*ThingBulkEsModel) ToEsDocuments ¶ added in v0.2.0
func (s *ThingBulkEsModel) ToEsDocuments() ([]Document, error)
Click to show internal directories.
Click to hide internal directories.