Kite defines a single process that enables distributed service messaging amongst the peers it is connected. A Kite process acts as a Client and as a Server. That means it can receive request, process them, but it also can make request to other kites. Do not use this struct directly. Use kite.New fu
| 52 | // with HandleFunc mehtod, then call Run method to start the inbuilt server (or |
| 53 | // pass it to any http.Handler compatible server) |
| 54 | type Kite struct { |
| 55 | Config *config.Config |
| 56 | |
| 57 | // Log logs with the given Logger interface |
| 58 | Log Logger |
| 59 | |
| 60 | // SetLogLevel changes the level of the logger. Default is INFO. |
| 61 | SetLogLevel func(Level) |
| 62 | |
| 63 | // Contains different functions for authenticating user from request. |
| 64 | // Keys are the authentication types (options.auth.type). |
| 65 | Authenticators map[string]func(*Request) error |
| 66 | |
| 67 | // ClientFunc is used as the default value for kite.Client.ClientFunc. |
| 68 | // If nil, a default ClientFunc will be used. |
| 69 | // |
| 70 | // Deprecated: Set Config.XHR field instead. |
| 71 | ClientFunc func(*sockjsclient.DialOptions) *http.Client |
| 72 | |
| 73 | // WebRTCHandler handles the webrtc responses coming from a signalling server. |
| 74 | WebRTCHandler Handler |
| 75 | |
| 76 | // Handlers added with Kite.HandleFunc(). |
| 77 | handlers map[string]*Method // method map for exported methods |
| 78 | preHandlers []Handler // a list of handlers that are executed before any handler |
| 79 | postHandlers []Handler // a list of handlers that are executed after any handler |
| 80 | finalFuncs []FinalFunc // a list of funcs executed after any handler regardless of the error |
| 81 | |
| 82 | // MethodHandling defines how the kite is returning the response for |
| 83 | // multiple handlers |
| 84 | MethodHandling MethodHandling |
| 85 | |
| 86 | // HTTP muxer |
| 87 | muxer *mux.Router |
| 88 | |
| 89 | // kontrolclient is used to register to kontrol and query third party kites |
| 90 | // from kontrol |
| 91 | kontrol *kontrolClient |
| 92 | |
| 93 | // kontrolKey stores parsed Config.KontrolKey |
| 94 | kontrolKey *rsa.PublicKey |
| 95 | |
| 96 | // configMu protects access to Config.{Kite,Kontrol}Key fields. |
| 97 | configMu sync.RWMutex |
| 98 | |
| 99 | // verifyCache is used as a cache for verify method. |
| 100 | // |
| 101 | // The field is set by verifyInit method. |
| 102 | verifyCache *cache.MemoryTTL |
| 103 | |
| 104 | // verifyFunc is a verify method used to verify auth keys. |
| 105 | // |
| 106 | // For more details see (config.Config).VerifyFunc. |
| 107 | // |
| 108 | // The field is set by verifyInit method. |
| 109 | verifyFunc func(pub string) error |
| 110 | |
| 111 | // verifyAudienceFunc is used to verify the audience of an |
nothing calls this directly
no outgoing calls
no test coverage detected