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

Function serverList

hide.me.go:59–73  ·  view source on GitHub ↗
( conf *Configuration, kind string )

Source from the content-addressed store, hash-verified

57}
58
59func serverList( conf *Configuration, kind string ) {
60 client := rest.New( conf.Rest ) // Create the REST client
61
62 dohResolver := doh.New(conf.DoH) // Create a DoH resolver
63 dohResolver.Init()
64 client.SetDohResolver(dohResolver)
65
66 plainResolver := plain.New(conf.Plain) // Create a Plain resolver
67 if err := plainResolver.Init(); err != nil { log.Println( "List: [ERR] Plain resolver init failed", err ); return }
68 client.SetPlainResolver(plainResolver)
69
70 ctx, cancel := context.WithTimeout( context.Background(), conf.Rest.RestTimeout )
71 defer cancel()
72 if err := client.PrintServerList( ctx, kind ); err != nil { log.Println( "List: [ERR] GET request failed:", err ); return } // Get JSON and print the list
73}
74
75func main() {
76 log.SetFlags( 0 )

Callers 1

mainFunction · 0.85

Calls 7

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

Tested by

no test coverage detected