Home Download Docs Code Community
import "perkeep/pkg/types/clientconfig"
Overview
Index

Overview ▾

Package clientconfig provides types related to the client configuration file.

Index

type Config
    func GenerateClientConfig(serverConfig jsonconfig.Obj) (*Config, error)
    func (conf *Config) Alias(server string) string
type Server

Package files

config.go

type Config

type Config struct {
    Servers            map[string]*Server `json:"servers"`                      // maps server alias to server config.
    Identity           string             `json:"identity"`                     // GPG identity.
    IdentitySecretRing string             `json:"identitySecretRing,omitempty"` // location of the secret ring file.
    IgnoredFiles       []string           `json:"ignoredFiles,omitempty"`       // list of files that pk-put should ignore.
}

Config holds the values from the JSON client config file.

func GenerateClientConfig

func GenerateClientConfig(serverConfig jsonconfig.Obj) (*Config, error)

GenerateClientConfig returns a client configuration which can be used to access a server defined by the provided low-level server configuration.

func (*Config) Alias

func (conf *Config) Alias(server string) string

Alias returns the alias of the server from conf that matches server, or the empty string if no match. A match means the server from the config is a prefix of the input server. The longest match prevails.

type Server

type Server struct {
    Server       string   `json:"server"`                 // server URL (scheme + hostname).
    Auth         string   `json:"auth"`                   // auth scheme and values (ex: userpass:foo:bar).
    IsDefault    bool     `json:"default,omitempty"`      // whether this server is the default one.
    TrustedCerts []string `json:"trustedCerts,omitempty"` // list of trusted certificates fingerprints.
}

Server holds the values specific to each server found in the JSON client config file.

Website layout inspired by memcached.
Content by the authors.