MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / NewDriver

Function NewDriver

log-driver/loki/loki.go:40–61  ·  view source on GitHub ↗
(config string)

Source from the content-addressed store, hash-verified

38}
39
40func NewDriver(config string) (*Driver, map[string]interface{}, error) {
41 cfg := new(DriverConfig)
42 err := json.Unmarshal([]byte(config), cfg)
43 if err != nil {
44 return nil, nil, err
45 }
46 err = cfg.Check()
47 if err != nil {
48 return nil, nil, err
49 }
50 headers := map[string]string{}
51 for _, h := range cfg.Header {
52 headers[h.Key] = h.Value
53 }
54 return &Driver{
55 url: cfg.URL,
56 headers: headers,
57 }, map[string]interface{}{
58 "url": cfg.URL,
59 "headers": headers,
60 }, nil
61}
62
63func (d *Driver) LogInfo(clusterId string, id string) (*log_driver.LogInfo, error) {
64 if id == "" {

Callers 2

CreateMethod · 0.70
TestLokiFunction · 0.70

Calls 1

CheckMethod · 0.65

Tested by 1

TestLokiFunction · 0.56