MCPcopy Create free account
hub / github.com/eventure/hide.client.linux / categories

Function categories

hide.me.go:43–57  ·  view source on GitHub ↗

Fetch and dump filtering categories

( conf *Configuration )

Source from the content-addressed store, hash-verified

41
42// Fetch and dump filtering categories
43func categories( conf *Configuration ) {
44 client := rest.New( conf.Rest ) // Create the REST client
45
46 dohResolver := doh.New(conf.DoH)
47 dohResolver.Init()
48 client.SetDohResolver(dohResolver)
49
50 plainResolver := plain.New(conf.Plain)
51 if err := plainResolver.Init(); err != nil { log.Println( "Cats: [ERR] Plain resolver init failed", err ); return }
52 client.SetPlainResolver(plainResolver)
53
54 ctx, cancel := context.WithTimeout( context.Background(), conf.Rest.RestTimeout )
55 defer cancel()
56 if err := client.FetchCategoryList( ctx ); err != nil { log.Println( "Cats: [ERR] GET request failed:", err ); return } // Get JSON
57}
58
59func serverList( conf *Configuration, kind string ) {
60 client := rest.New( conf.Rest ) // Create the REST client

Callers 1

mainFunction · 0.85

Calls 7

NewFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
SetDohResolverMethod · 0.80
SetPlainResolverMethod · 0.80
FetchCategoryListMethod · 0.80
InitMethod · 0.45

Tested by

no test coverage detected