rclone: github.com/rclone/rclone/fs/config/configmap Index | Files

package configmap

import "github.com/rclone/rclone/fs/config/configmap"

Package configmap provides an abstraction for reading and writing config

Index

Package Files

configmap.go

type Getter Uses

type Getter interface {
    // Get should get an item with the key passed in and return
    // the value. If the item is found then it should return true,
    // otherwise false.
    Get(key string) (value string, ok bool)
}

Getter provides an interface to get config items

type Map Uses

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

Map provides a wrapper around multiple Setter and Getter interfaces.

func New Uses

func New() *Map

New returns an empty Map

func (*Map) AddGetter Uses

func (c *Map) AddGetter(getter Getter) *Map

AddGetter appends a getter onto the end of the getters

func (*Map) AddGetters Uses

func (c *Map) AddGetters(getters ...Getter) *Map

AddGetters appends multiple getters onto the end of the getters

func (*Map) AddSetter Uses

func (c *Map) AddSetter(setter Setter) *Map

AddSetter appends a setter onto the end of the setters

func (*Map) Get Uses

func (c *Map) Get(key string) (value string, ok bool)

Get gets an item with the key passed in and return the value from the first getter. If the item is found then it returns true, otherwise false.

func (*Map) Set Uses

func (c *Map) Set(key, value string)

Set sets an item into all the stored setters.

type Mapper Uses

type Mapper interface {
    Getter
    Setter
}

Mapper provides an interface to read and write config

type Setter Uses

type Setter interface {
    // Set should set an item into persistent config store.
    Set(key, value string)
}

Setter provides an interface to set config items

type Simple Uses

type Simple map[string]string

Simple is a simple Mapper for testing

func (Simple) Get Uses

func (c Simple) Get(key string) (value string, ok bool)

Get the value

func (Simple) Set Uses

func (c Simple) Set(key, value string)

Set the value

Package configmap is imported by 92 packages. Updated 2019-07-28. Refresh now. Tools for package owners.