client

package
v0.0.0-...-0a4d78a Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKarteClient

func GetKarteClient(ctx context.Context) kartepb.KarteClient

GetKarteClient retrieves a Karte client from the context.

func NewClient

func NewClient(ctx context.Context, c *Config, o ...Option) (kartepb.KarteClient, error)

NewClient creates a new client for the Karte service.

func NewCronClient

func NewCronClient(ctx context.Context, c *Config, o ...Option) (kartepb.KarteCronClient, error)

NewCronClient creates a new client for the Karte service.

func WithKarteClient

func WithKarteClient(ctx context.Context, client kartepb.KarteClient) context.Context

WithKarteClient adds a Karte client to the context.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config stores options needed for the Karte service.

func DevConfig

func DevConfig(o auth.Options) *Config

DevConfig returns a configuration for the Karte client intended to talk to the dev instance of Karte, which is a cloud project.

The auth options are required and must be passed in explicitly. The hostname and type of login are set to reasonable defaults for a local command line tool.

func EmptyConfig

func EmptyConfig() *Config

EmptyConfig is a config with no content. It is expected to fail to construct a client if used as the base config without the appropriate options being set.

func LocalConfig

func LocalConfig(o auth.Options) *Config

LocalConfig returns a configuration for the Karte client intended for local use, such as in the karte command line tool.

The auth options are required and must be passed in explicitly. The hostname and type of login are set to reasonable defaults for a local command line tool.

func ProdConfig

func ProdConfig(o auth.Options) *Config

ProdConfig returns a configuration for the Karte client intended to talk to the dev instance of Karte, which is a cloud project.

The auth options are required and must be passed in explicitly. The hostname and type of login are set to reasonable defaults for a local command line tool.

type Option

type Option func(*Config)

Option is a configuration option. For example `UserAgent(...)` would be an option.

Jump to

Keyboard shortcuts

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