github.com/netdata/go.d.plugin@v0.58.1/agent/discovery/sd/conffile.go (about) 1 // SPDX-License-Identifier: GPL-3.0-or-later 2 3 package sd 4 5 import ( 6 "context" 7 8 "github.com/ilyam8/hashstructure" 9 ) 10 11 type ConfigFileProvider interface { 12 Run(ctx context.Context) 13 Configs() chan ConfigFile 14 } 15 16 type ConfigFile struct { 17 Source string 18 Data []byte 19 } 20 21 func (c *ConfigFile) Hash() uint64 { 22 h, _ := hashstructure.Hash(c, nil) 23 return h 24 }