state

package
v1.26.13 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: BSD-3-Clause Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	OIDC            *oidc.Client
	AnonymousAccess *anonymous.Client
	APIKey          *apikey.Client
	Authorizer      authorization.Authorizer
	ServerConfig    *config.WeaviateConfig
	Locks           locks.ConnectorSchemaLock
	Logger          *logrus.Logger

	GraphQL               graphql.GraphQL
	Modules               *modules.Provider
	SchemaManager         *schema.Manager
	Scaler                *scaler.Scaler
	Cluster               *cluster.State
	RemoteIndexIncoming   *sharding.RemoteIndexIncoming
	RemoteNodeIncoming    *sharding.RemoteNodeIncoming
	RemoteReplicaIncoming *replica.RemoteReplicaIncoming
	Traverser             *traverser.Traverser

	ClassificationRepo *classifications.DistributedRepo
	Metrics            *monitoring.PrometheusMetrics
	BackupManager      *backup.Handler
	DB                 *db.DB
	BatchManager       *objects.BatchManager
	ClusterHttpClient  *http.Client
	ReindexCtxCancel   context.CancelFunc
	MemWatch           *memwatch.Monitor

	ClusterService *rCluster.Service
	TenantActivity *tenantactivity.Handler
	// contains filtered or unexported fields
}

State is the only source of application-wide state NOTE: This is not true yet, see gh-723 TODO: remove dependencies to anything that's not an ent or uc

func (*State) GetGraphQL

func (s *State) GetGraphQL() graphql.GraphQL

GetGraphQL is the safe way to retrieve GraphQL from the state as it can be replaced at runtime. Instead of passing appState.GraphQL to your adapters, pass appState itself which you can abstract with a local interface such as:

type gqlProvider interface { GetGraphQL graphql.GraphQL }

func (*State) SetGraphQL added in v1.22.6

func (s *State) SetGraphQL(gql graphql.GraphQL)

Jump to

Keyboard shortcuts

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