camlistore.org: camlistore.org/pkg/types/clientconfig Index | Files

package clientconfig

import "camlistore.org/pkg/types/clientconfig"

Package clientconfig provides types related to the client configuration file.

Index

Package Files

config.go

type Config Uses

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 camput should ignore.
}

Config holds the values from the JSON client config file.

func GenerateClientConfig Uses

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 Uses

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 Uses

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.

Package clientconfig imports 6 packages (graph) and is imported by 29 packages. Updated 2018-01-16. Refresh now. Tools for package owners.