Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around the file client
func New ¶
New returns a new FileClient The filepath can be a local path to a file or a remote http/https location.
func (*Client) Close ¶
func (c *Client) Close()
Close is only meant to fulfill the easykv.ReadWatcher interface. Does nothing.
func (*Client) GetValues ¶
GetValues returns all key-value pairs from the yaml or json file where the keys begins with one of the prefixes specified in the keys array.
func (*Client) WatchPrefix ¶
func (c *Client) WatchPrefix(ctx context.Context, prefix string, opts ...easykv.WatchOption) (uint64, error)
WatchPrefix watches the file for changes with fsnotify. Prefix, keys and waitIndex are only here to implement the StoreClient interface. WatchPrefix is only supported for local files. Remote files over http/https arent supported. Remote filesystems like nfs are also not supported.
type Option ¶ added in v1.2.5
type Option func(*Options)
Option configures the file client.
func WithHeaders ¶ added in v1.2.5
WithHeaders sets the headers for the HTTP request made when fetching remote files.