client

package
v0.0.0-...-a7ced60 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TestRootDirEnvKey is the environment variable key used to set the file system root when testing.
	TestRootDirEnvKey = "PLANNER_TEST_ROOT_DIR"
)

Variables

This section is empty.

Functions

func DefaultPlannerClientConfigPath

func DefaultPlannerClientConfigPath() string

DefaultPlannerClientConfigPath returns the default path to the Planner client config file.

func NewFromConfig

func NewFromConfig(config *Config) (*client.ClientWithResponses, error)

NewFromConfig returns a new Planner API client from the given config.

func NewFromConfigFile

func NewFromConfigFile(filename string) (*client.ClientWithResponses, error)

NewFromConfigFile returns a new Planner API client using the config read from the given file.

func NewHTTPClientFromConfig

func NewHTTPClientFromConfig(config *Config) (*http.Client, error)

NewHTTPClientFromConfig returns a new HTTP Client from the given config.

func WriteConfig

func WriteConfig(filename string, server string) error

WriteConfig writes a client config file using the given parameters.

Types

type Config

type Config struct {
	Service Service `json:"service"`
	// contains filtered or unexported fields
}

Config holds the information needed to connect to a Planner API server

func NewDefault

func NewDefault() *Config

func ParseConfigFile

func ParseConfigFile(filename string) (*Config, error)

func (*Config) DeepCopy

func (c *Config) DeepCopy() *Config

func (*Config) Equal

func (c *Config) Equal(c2 *Config) bool

func (*Config) Persist

func (c *Config) Persist(filename string) error

func (*Config) SetBaseDir

func (c *Config) SetBaseDir(baseDir string)

func (*Config) Validate

func (c *Config) Validate() error

type Service

type Service struct {
	// Server is the URL of the Planner API server (the part before /api/v1/...).
	Server string `json:"server"`
	UI     string `json:"ui"`
}

Service contains information how to connect to and authenticate the Planner API server.

func (*Service) DeepCopy

func (s *Service) DeepCopy() *Service

func (*Service) Equal

func (s *Service) Equal(s2 *Service) bool

Jump to

Keyboard shortcuts

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