grpc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, addr string, opts ...grpc.DialOption) (membershipgrpc.ServerClient, error)

func CountDocument

func CountDocument(indexName string) (int64, error)

func NewModule

func NewModule(id, serverAddress string, baseUrl *url.URL, production bool, authenticator Authenticator, opts ...grpc.DialOption) fx.Option

Types

type Authenticator

type Authenticator interface {
	// contains filtered or unexported methods
}

type AuthenticatorFn

type AuthenticatorFn func(ctx context.Context) (metadata.MD, error)

func BearerAuthenticator

func BearerAuthenticator(issuer, clientID, clientSecret string) AuthenticatorFn

func TokenAuthenticator

func TokenAuthenticator(token string) AuthenticatorFn

type K8SClient

type K8SClient interface {
	Get(ctx context.Context, name string, options metav1.GetOptions) (*v1beta3.Stack, error)
	Create(ctx context.Context, stack *v1beta3.Stack) (*v1beta3.Stack, error)
	Update(ctx context.Context, stack *v1beta3.Stack) (*v1beta3.Stack, error)
	Delete(ctx context.Context, name string) error
}

type Response

type Response struct {
	Took     int  `json:"took"`
	TimedOut bool `json:"timed_out"`
	Shards   struct {
		Total      int `json:"total"`
		Successful int `json:"successful"`
		Skipped    int `json:"skipped"`
		Failed     int `json:"failed"`
	} `json:"_shards"`
	Hits struct {
		Total struct {
			Value    int    `json:"value"`
			Relation string `json:"relation"`
		} `json:"total"`
		MaxScore interface{}   `json:"max_score"`
		Hits     []interface{} `json:"hits"`
	} `json:"hits"`
	Aggregations struct {
		ByIndex struct {
			DocCountErrorUpperBound int `json:"doc_count_error_upper_bound"`
			SumOtherDocCount        int `json:"sum_other_doc_count"`
			Buckets                 []struct {
				Key      string `json:"key"`
				DocCount int    `json:"doc_count"`
			} `json:"buckets"`
		} `json:"by_index"`
	} `json:"aggregations"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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