config

package module
v0.0.0-...-0c1b418 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

README

Package cloudeng.io/glean/config

import cloudeng.io/glean/config

Package extensions contains a set of subcmd extensions that can be used by gleancli implementations. Each such extension is a submodule so that its dependencies are imported only by gleancli implementations that use it.

Types

Type DatasourceConfig
type DatasourceConfig struct {
	GleanInstance                   string `yaml:"glean_instance"`
	gleansdk.CustomDatasourceConfig `yaml:",inline"`
}

DatasourceConfig represents the configuration of the datasource with Glean's API.

Type Extension
type Extension interface {
	subcmd.Extension
	SetGleanConfig(*Glean)
	GleanConfig() *Glean
}
Functions
func NewExtension(name, spec string, appendFn func(cmdSet *subcmd.CommandSetYAML) error) Extension
Type Glean
type Glean []struct {
	Name string `yaml:"name"`
	Auth struct {
		BearerToken string `yaml:"token"`
	}
	API struct {
		Domain string `yaml:"domain"`
	}
}
Methods
func (c Glean) NewAPIClient(ctx context.Context, name string) (context.Context, *gleansdk.APIClient, error)
func (c Glean) String() string
Type GleanFlags
type GleanFlags struct {
	Config string `subcmd:"config,$HOME/.glean.yaml,'glean config file'"`
}

Documentation

Overview

Package extensions contains a set of subcmd extensions that can be used by gleancli implementations. Each such extension is a submodule so that its dependencies are imported only by gleancli implementations that use it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatasourceConfig

type DatasourceConfig struct {
	GleanInstance                   string `yaml:"glean_instance" cmd:"glean instance to use"`
	gleansdk.CustomDatasourceConfig `yaml:",inline" cmd:"glean custom datasource configuration"`
}

DatasourceConfig represents the configuration of the datasource with Glean's API.

type Extension

type Extension interface {
	subcmd.Extension
	SetOptions(ExtensionOptions)
	Options() ExtensionOptions
	AuthConfigType() any
	ServiceConfigType() any
}

func NewExtension

func NewExtension(name, spec string, authCfgType, serviceCfgType any, appendFn func(cmdSet *subcmd.CommandSetYAML) error) Extension

func NewExtensionC

func NewExtensionC(spec ExtensionSpec, parents []string) Extension

type ExtensionOptions

type ExtensionOptions struct {
	Glean
	CreateStoreFS      func(ctx context.Context, path string, cfg yaml.Node) (operations.FS, error)
	CreateCheckpointOp func(ctx context.Context, path string, cfg yaml.Node) (checkpoint.Operation, error)
}

type ExtensionSpec

type ExtensionSpec struct {
	Name       string // Name of the extension
	CmdSpec    string // YAML subcmd spec
	AuthCfg    any    // used for describing the auth configuration
	ServiceCfg any    // used for describing the service configuration
	// called to add the command to its parent cmdSet.
	AddFunc func(extension Extension, cmdSet *subcmd.CommandSetYAML, parents []string) error
}

type Glean

type Glean []struct {
	Name string `yaml:"name" cmd:"name of the glean instance"`
	Auth struct {
		BearerToken       string `yaml:"indexing_token" cmd:"indexing token for the glean instance"`
		ClientBearerToken string `yaml:"client_token" cmd:"client bearer token for the glean instance"`
	}
	API struct {
		Domain string `yaml:"domain" cmd:"domain for the glean instance"`
	}
}

func (Glean) NewClientAPIClient

func (c Glean) NewClientAPIClient(ctx context.Context, name string) (context.Context, *gleanclientsdk.APIClient, error)

func (Glean) NewIndexingAPIClient

func (c Glean) NewIndexingAPIClient(ctx context.Context, name string) (context.Context, *gleansdk.APIClient, error)

func (Glean) String

func (c Glean) String() string

type GleanFlags

type GleanFlags struct {
	Config string `subcmd:"config,$HOME/.glean.yaml,'glean config file'"`
}

Jump to

Keyboard shortcuts

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