Documentation
¶
Index ¶
- Constants
- Variables
- func OpenAPIHandler(c *Context) (any, error)
- func ShutdownWithContext(ctx context.Context, shutdownFunc func(ctx context.Context) error, ...) error
- func SwaggerUIHandler(c *Context) (any, error)
- type App
- func (a *App) AddArangoDB(db infra.ArangoDBProvider)
- func (a *App) AddCassandra(db infra.CassandraProvider)
- func (a *App) AddClickhouse(db infra.ClickhouseProvider)
- func (a *App) AddCouchbase(db infra.CouchbaseProvider)
- func (a *App) AddCronJob(schedule, jobName string, job CronFunc)
- func (a *App) AddDBResolver(resolver infra.DBResolverProvider)
- func (a *App) AddDgraph(db infra.DgraphProvider)
- func (a *App) AddElasticsearch(db infra.ElasticsearchProvider)
- func (a *App) AddFTP(fs file.FileSystemProvider)
- func (a *App) AddFileStore(fs file.FileSystemProvider)
- func (a *App) AddGRPCServerOptions(grpcOpts ...grpc.ServerOption)
- func (a *App) AddGRPCServerStreamInterceptors(interceptors ...grpc.StreamServerInterceptor)
- func (a *App) AddGRPCUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor)
- func (a *App) AddHTTPService(serviceName, serviceAddress string, options ...service.Options)
- func (a *App) AddInfluxDB(db infra.InfluxDBProvider)
- func (a *App) AddKVStore(db infra.KVStoreProvider)
- func (a *App) AddMongo(db infra.MongoProvider)
- func (a *App) AddOpenTSDB(db infra.OpenTSDBProvider)
- func (a *App) AddOracle(db infra.OracleProvider)
- func (a *App) AddPubSub(pubsub infra.PubSubProvider)
- func (a *App) AddRESTHandlers(object any) error
- func (a *App) AddScyllaDB(db infra.ScyllaDBProvider)
- func (a *App) AddSolr(db infra.SolrProvider)
- func (a *App) AddStaticFiles(endpoint, filePath string)
- func (a *App) AddSurrealDB(db infra.SurrealBDProvider)
- func (a *App) AddWSService(serviceName, url string, headers http.Header, enableReconnection bool, ...) error
- func (a *App) Container() *infra.Container
- func (a *App) DELETE(pattern string, handler Handler)
- func (a *App) EnableAPIKeyAuth(apiKeys ...string)
- func (a *App) EnableAPIKeyAuthWithFunc(validateFunc func(apiKey string) bool)deprecated
- func (a *App) EnableAPIKeyAuthWithValidator(validateFunc func(c *infra.Container, apiKey string) bool)
- func (a *App) EnableBasicAuth(credentials ...string)
- func (a *App) EnableBasicAuthWithFunc(validateFunc func(username, password string) bool)deprecated
- func (a *App) EnableBasicAuthWithValidator(validateFunc func(c *infra.Container, username, password string) bool)
- func (a *App) EnableOAuth(jwksEndpoint string, refreshInterval int, options ...jwt.ParserOption)
- func (a *App) EnableRBAC(configPath ...string)
- func (a *App) GET(pattern string, handler Handler)
- func (a *App) GetSQL() infra.DB
- func (a *App) Group(prefix string, fns ...func(sub *RouteGroup)) *RouteGroup
- func (a *App) Logger() logging.Logger
- func (a *App) Metrics() metrics.Manager
- func (a *App) Migrate(migrationsMap map[int64]migration.Migrate)
- func (a *App) OnStart(hook func(ctx *Context) error)
- func (a *App) OverrideWebsocketUpgrader(wsUpgrader websocket.Upgrader)
- func (a *App) PATCH(pattern string, handler Handler)
- func (a *App) POST(pattern string, handler Handler)
- func (a *App) PUT(pattern string, handler Handler)
- func (a *App) RegisterService(desc *grpc.ServiceDesc, impl any)
- func (a *App) Run()
- func (a *App) Shutdown(ctx context.Context) error
- func (a *App) SubCommand(pattern string, handler Handler, options ...Options)
- func (a *App) Subscribe(topic string, handler SubscribeFunc)
- func (a *App) Use(middlewares ...func(http.Handler) http.Handler)
- func (a *App) UseMiddleware(middlewares ...KiteMiddleware)
- func (a *App) UseMiddlewareWithContainer(middlewareHandler func(c *infra.Container, handler http.Handler) http.Handler)
- func (a *App) UseMongo(db infra.Mongo)
- func (a *App) WebSocket(route string, handler Handler)
- type AuthInfo
- type CRUD
- type Context
- type Create
- type CronFunc
- type Crontab
- type Delete
- type ErrCommandNotFound
- type ErrorLogEntry
- type Exporter
- type Get
- type GetAll
- type GroupNode
- type Handler
- type KiteMiddleware
- type Options
- type Request
- type Responder
- type RestPathOverrider
- type RouteDef
- type RouteGroup
- func (g *RouteGroup) DELETE(pattern string, h Handler) *RouteGroup
- func (g *RouteGroup) GET(pattern string, h Handler) *RouteGroup
- func (g *RouteGroup) Group(prefix string, fns ...func(sub *RouteGroup)) *RouteGroup
- func (g *RouteGroup) PATCH(pattern string, h Handler) *RouteGroup
- func (g *RouteGroup) POST(pattern string, h Handler) *RouteGroup
- func (g *RouteGroup) PUT(pattern string, h Handler) *RouteGroup
- func (g *RouteGroup) Use(mws ...func(http.Handler) http.Handler) *RouteGroup
- func (g *RouteGroup) UseMiddleware(mws ...KiteMiddleware) *RouteGroup
- type RouteRegistry
- type Span
- type SubscribeFunc
- type SubscriptionManager
- type TableNameOverrider
- type Update
Constants ¶
const (
OpenAPIJSON = "openapi.json"
)
Variables ¶
var ( ErrMarshalingResponse = errors.New("error marshaling response") ErrConnectionNotFound = errors.New("connection not found for service") )
Functions ¶
func OpenAPIHandler ¶
OpenAPIHandler serves the `openapi.json` file at the specified path. It reads the file from the disk and returns its content as a response.
func ShutdownWithContext ¶
func ShutdownWithContext(ctx context.Context, shutdownFunc func(ctx context.Context) error, forceCloseFunc func() error) error
ShutdownWithContext handles the shutdown process with context timeout. It takes a shutdown function and a force close function as parameters. If the context times out, the force close function is called.
func SwaggerUIHandler ¶
SwaggerUIHandler serves the static files of the Swagger UI.
Types ¶
type App ¶
type App struct {
// Config can be used by applications to fetch custom configurations from environment or file.
Config config.Config // If we directly embed, unnecessary confusion between app.Get and app.GET will happen.
// contains filtered or unexported fields
}
App is the main application in the Kite framework.
func (*App) AddArangoDB ¶
func (a *App) AddArangoDB(db infra.ArangoDBProvider)
AddArangoDB sets the ArangoDB datasource in the app's infra.
func (*App) AddCassandra ¶
func (a *App) AddCassandra(db infra.CassandraProvider)
AddCassandra sets the Cassandra datasource in the app's infra.
func (*App) AddClickhouse ¶
func (a *App) AddClickhouse(db infra.ClickhouseProvider)
AddClickhouse initializes the clickhouse client. Official implementation is available in the package : github.com/sllt/kite/pkg/kite/datasource/clickhouse .
func (*App) AddCouchbase ¶
func (a *App) AddCouchbase(db infra.CouchbaseProvider)
func (*App) AddCronJob ¶
AddCronJob registers a cron job to the cron table. The cron expression can be either a 5-part or 6-part format. The 6-part format includes an optional second field (in beginning) and others being minute, hour, day, month and day of week respectively.
func (*App) AddDBResolver ¶
func (a *App) AddDBResolver(resolver infra.DBResolverProvider)
AddDBResolver sets up database resolver with read/write splitting.
func (*App) AddDgraph ¶
func (a *App) AddDgraph(db infra.DgraphProvider)
AddDgraph sets the Dgraph datasource in the app's infra.
func (*App) AddElasticsearch ¶
func (a *App) AddElasticsearch(db infra.ElasticsearchProvider)
func (*App) AddFTP ¶
func (a *App) AddFTP(fs file.FileSystemProvider)
AddFTP sets the FTP datasource in the app's infra. Deprecated: Use the AddFile method instead.
func (*App) AddFileStore ¶
func (a *App) AddFileStore(fs file.FileSystemProvider)
AddFileStore sets the FTP, SFTP, S3, GCS, or Azure File Storage datasource in the app's infra.
func (*App) AddGRPCServerOptions ¶
func (a *App) AddGRPCServerOptions(grpcOpts ...grpc.ServerOption)
AddGRPCServerOptions allows users to add custom gRPC server options such as TLS configuration, timeouts, interceptors, and other server-specific settings in a single call.
Example:
// Add TLS credentials and connection timeout in one call
creds, _ := credentials.NewServerTLSFromFile("server-cert.pem", "server-key.pem")
app.AddGRPCServerOptions(
grpc.Creds(creds),
grpc.ConnectionTimeout(10 * time.Second),
)
This function accepts a variadic list of gRPC server options (grpc.ServerOption) and appends them to the server's configuration. It allows fine-tuning of the gRPC server's behavior during its initialization.
func (*App) AddGRPCServerStreamInterceptors ¶
func (a *App) AddGRPCServerStreamInterceptors(interceptors ...grpc.StreamServerInterceptor)
func (*App) AddGRPCUnaryInterceptors ¶
func (a *App) AddGRPCUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor)
AddGRPCUnaryInterceptors allows users to add custom gRPC interceptors. Example:
func loggingInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler) (interface{}, error) {
log.Printf("Received gRPC request: %s", info.FullMethod)
return handler(ctx, req)
}
app.AddGRPCUnaryInterceptors(loggingInterceptor)
func (*App) AddHTTPService ¶
AddHTTPService registers HTTP service in infra.
func (*App) AddInfluxDB ¶
func (a *App) AddInfluxDB(db infra.InfluxDBProvider)
func (*App) AddKVStore ¶
func (a *App) AddKVStore(db infra.KVStoreProvider)
AddKVStore sets the KV-Store datasource in the app's infra.
func (*App) AddMongo ¶
func (a *App) AddMongo(db infra.MongoProvider)
AddMongo sets the Mongo datasource in the app's infra.
func (*App) AddOpenTSDB ¶
func (a *App) AddOpenTSDB(db infra.OpenTSDBProvider)
AddOpenTSDB sets the OpenTSDB datasource in the app's infra.
func (*App) AddOracle ¶
func (a *App) AddOracle(db infra.OracleProvider)
AddOracle initializes the OracleDB client. Official implementation is available in the package: github.com/sllt/kite/pkg/kite/datasource/oracle.
func (*App) AddPubSub ¶
func (a *App) AddPubSub(pubsub infra.PubSubProvider)
AddPubSub sets the PubSub client in the app's infra.
func (*App) AddRESTHandlers ¶
AddRESTHandlers creates and registers CRUD routes for the given struct, the struct should always be passed by reference.
func (*App) AddScyllaDB ¶
func (a *App) AddScyllaDB(db infra.ScyllaDBProvider)
AddScyllaDB sets the ScyllaDB datasource in the app's infra.
func (*App) AddSolr ¶
func (a *App) AddSolr(db infra.SolrProvider)
AddSolr sets the Solr datasource in the app's infra.
func (*App) AddStaticFiles ¶
AddStaticFiles registers a static file endpoint for the application.
The provided `endpoint` will be used as the prefix for the static file server. The `filePath` specifies the directory containing the static files. If `filePath` starts with "./", it will be interpreted as a relative path to the current working directory.
func (*App) AddSurrealDB ¶
func (a *App) AddSurrealDB(db infra.SurrealBDProvider)
func (*App) AddWSService ¶
func (a *App) AddWSService(serviceName, url string, headers http.Header, enableReconnection bool, retryInterval time.Duration) error
AddWSService registers a WebSocket service, establishes a persistent connection, and optionally handles reconnection.
func (*App) Container ¶
Container returns the container instance associated with the App. This allows access to all registered datasources (SQL, Redis, Mongo, etc.) for dependency injection in layered architectures.
func (*App) EnableAPIKeyAuth ¶
EnableAPIKeyAuth enables API key authentication for the application.
It requires at least one API key to be provided. The provided API keys will be used to authenticate requests.
func (*App) EnableAPIKeyAuthWithFunc
deprecated
EnableAPIKeyAuthWithFunc enables API key authentication for the application with a custom validation function.
Deprecated: This method is deprecated and will be removed in future releases, users must use App.EnableAPIKeyAuthWithValidator as it has access to application datasources.
func (*App) EnableAPIKeyAuthWithValidator ¶
func (a *App) EnableAPIKeyAuthWithValidator(validateFunc func(c *infra.Container, apiKey string) bool)
EnableAPIKeyAuthWithValidator enables API key authentication for the application with a custom validation function.
The provided `validateFunc` is used to determine the validity of an API key. It receives the request container and the API key as arguments and should return `true` if the key is valid, `false` otherwise.
func (*App) EnableBasicAuth ¶
EnableBasicAuth enables basic authentication for the application.
It takes a variable number of credentials as alternating username and password strings. An error is logged if an odd number of arguments is provided.
func (*App) EnableBasicAuthWithFunc
deprecated
EnableBasicAuthWithFunc enables basic authentication for the HTTP server with a custom validation function.
Deprecated: This method is deprecated and will be removed in future releases, users must use App.EnableBasicAuthWithValidator as it has access to application datasources.
func (*App) EnableBasicAuthWithValidator ¶
func (a *App) EnableBasicAuthWithValidator(validateFunc func(c *infra.Container, username, password string) bool)
EnableBasicAuthWithValidator enables basic authentication for the HTTP server with a custom validator.
The provided `validateFunc` is invoked for each authentication attempt. It receives a container instance, username, and password. The function should return `true` if the credentials are valid, `false` otherwise.
func (*App) EnableOAuth ¶
func (a *App) EnableOAuth(jwksEndpoint string, refreshInterval int, options ...jwt.ParserOption, )
EnableOAuth configures OAuth middleware for the application.
It registers a new HTTP service for fetching JWKS and sets up OAuth middleware with the given JWKS endpoint and refresh interval.
The JWKS endpoint is used to retrieve JSON Web Key Sets for verifying tokens. The refresh interval specifies how often to refresh the token cache. We can define optional JWT claim validation settings, including issuer, audience, and expiration checks. Accepts jwt.ParserOption for additional parsing options: https://pkg.go.dev/github.com/golang-jwt/jwt/v4#ParserOption
func (*App) EnableRBAC ¶
EnableRBAC enables RBAC by loading configuration from a JSON or YAML file. It loads the config directly and sets up the middleware.
Pure config-based: All authorization rules are defined in the config file using: - Roles: role → permission mapping (format: "resource:action") - Endpoints: route & method → permission mapping
Usage:
// Use default paths (configs/rbac.json, configs/rbac.yaml, configs/rbac.yml)
// Uses rbac.DefaultConfigPath internally
app.EnableRBAC()
// Or with custom config path
app.EnableRBAC("configs/custom-rbac.json")
Role extraction is configured in the config file: - Set "roleHeader" for header-based extraction (e.g., "X-User-Role") - Set "jwtClaimPath" for JWT-based extraction (e.g., "role", "roles[0]").
func (*App) Group ¶ added in v0.2.0
func (a *App) Group(prefix string, fns ...func(sub *RouteGroup)) *RouteGroup
Group creates or gets a route group with the given prefix and returns it. An optional callback can be provided for backward-compatible inline registration.
func (*App) Migrate ¶
Migrate applies a set of migrations to the application's database.
The migrationsMap argument is a map where the key is the version number of the migration and the value is a migration.Migrate instance that implements the migration logic.
func (*App) OnStart ¶
OnStart registers a startup hook that will be executed when the application starts. The hook function receives a Context that provides access to the application's container, logger, and configuration. This is useful for performing initialization tasks such as database connections, service registrations, or other setup operations that need to be completed before the application begins serving requests.
Example usage:
app := kite.New()
app.OnStart(func(ctx *kite.Context) error {
// Initialize database connection
db, err := database.Connect(ctx.Config.Get("DB_URL"))
if err != nil {
return err
}
ctx.Container.SQL = db
return nil
})
func (*App) OverrideWebsocketUpgrader ¶
func (*App) RegisterService ¶
func (a *App) RegisterService(desc *grpc.ServiceDesc, impl any)
RegisterService adds a gRPC service to the Kite application.
func (*App) Run ¶
func (a *App) Run()
Run starts the application. If it is an HTTP server, it will start the server.
func (*App) Shutdown ¶
Shutdown stops the service(s) and close the application. It shuts down the HTTP, gRPC, Metrics servers and closes the container's active connections to datasources.
func (*App) SubCommand ¶
SubCommand adds a sub-command to the CLI application. Can be used to create commands like "kubectl get" or "kubectl get ingress".
func (*App) Subscribe ¶
func (a *App) Subscribe(topic string, handler SubscribeFunc)
Subscribe registers a handler for the given topic.
If the subscriber is not initialized in the container, an error is logged and the subscription is not registered.
func (*App) Use ¶ added in v0.2.0
Use registers HTTP middleware (func(http.Handler) http.Handler) at the global level. These run at the HTTP layer before the kite Context is created.
func (*App) UseMiddleware ¶
func (a *App) UseMiddleware(middlewares ...KiteMiddleware)
UseMiddleware registers KiteMiddleware that runs at the application layer with *Context access. This is a BREAKING CHANGE: the signature changed from func(http.Handler) http.Handler to func(next Handler) Handler (KiteMiddleware).
func (*App) UseMiddlewareWithContainer ¶
func (a *App) UseMiddlewareWithContainer(middlewareHandler func(c *infra.Container, handler http.Handler) http.Handler)
UseMiddlewareWithContainer adds a middleware that has access to the container and wraps the provided handler with the middleware logic.
The `middleware` function receives the container and the handler, allowing the middleware to modify the request processing flow. Deprecated: UseMiddlewareWithContainer will be removed in a future release. Please use the *App.UseMiddleware method that does not depend on the infra.
func (*App) UseMongo ¶
UseMongo sets the Mongo datasource in the app's infra. Deprecated: Use the AddMongo method instead.
func (*App) WebSocket ¶
WebSocket registers a handler function for a WebSocket route. This method allows you to define a route handler for WebSocket connections. It internally handles the WebSocket handshake and provides a `websocket.Connection` object within the handler context. User can access the underlying WebSocket connection using `ctx.GetWebsocketConnection()`.
type Context ¶
type Context struct {
context.Context
// Request needs to be public because handlers need to access request details. Else, we need to provide all
// functionalities of the Request as a method on context. This is not needed because Request here is an interface
// So, internals are not exposed anyway.
Request
// Same logic as above.
*infra.Container
// Terminal needs to be public as CMD applications need to access various terminal user interface(TUI) features.
Out terminal.Output
logging.ContextLogger
// contains filtered or unexported fields
}
func (*Context) GetAuthInfo ¶
GetAuthInfo is a method on context, to access different methods to retrieve authentication info.
GetAuthInfo().GetClaims() : retrieves the jwt claims. GetAuthInfo().GetUsername() : retrieves the username while basic authentication. GetAuthInfo().GetAPIKey() : retrieves the APIKey being used for authentication.
func (*Context) GetCorrelationID ¶
func (*Context) Trace ¶
Trace returns an open telemetry span. We have to always close the span after corresponding work is done. Usages:
span := c.Trace("Some Work")
// Do some work here.
defer span.End()
If an entire function has to traced as span, we can use a simpler format:
defer c.Trace("ExampleHandler").End()
We can write this at the start of function and because of how defer works, trace will start at that line but End will be called after function ends.
Developer Note: If you chain methods in a defer statement, everything except the last function will be evaluated at call time.
func (*Context) WriteMessageToService ¶
WriteMessageToService writes a message to the WebSocket connection associated with the given service name. The data parameter can be of type string, []byte, or any struct that can be marshaled to JSON.
func (*Context) WriteMessageToSocket ¶
WriteMessageToSocket writes a message to the WebSocket connection associated with the context. The data parameter can be of type string, []byte, or any struct that can be marshaled to JSON. It retrieves the WebSocket connection from the context and sends the message as a TextMessage.
type Crontab ¶
type Crontab struct {
// contains filtered or unexported fields
}
Crontab maintains the job scheduling and runs the jobs at their scheduled time by going through them at each tick using a ticker.
type ErrCommandNotFound ¶
type ErrCommandNotFound struct {
Command string
}
ErrCommandNotFound is an empty struct used to represent a specific error when a command is not found.
func (ErrCommandNotFound) Error ¶
func (e ErrCommandNotFound) Error() string
type ErrorLogEntry ¶
type ErrorLogEntry struct {
TraceID string `json:"trace_id,omitempty"`
Error string `json:"error,omitempty"`
}
func (*ErrorLogEntry) PrettyPrint ¶
func (el *ErrorLogEntry) PrettyPrint(writer io.Writer)
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter is responsible for exporting spans to a remote endpoint.
func NewExporter ¶
NewExporter creates a new Exporter instance with a custom endpoint and logger.
func (*Exporter) ExportSpans ¶
ExportSpans exports spans to the configured remote endpoint.
type GroupNode ¶ added in v0.2.0
type GroupNode struct {
// contains filtered or unexported fields
}
GroupNode is a node in the route group tree. It holds middleware and routes for a given prefix, plus child groups.
type KiteMiddleware ¶ added in v0.2.0
KiteMiddleware operates at the application layer with full *Context access. It wraps a Handler, optionally calling next to continue the chain. To short-circuit, return (nil, err) without calling next(c).
type Options ¶
type Options func(c *route)
Options is a function type used to configure a route in the command handler.
func AddDescription ¶
AddDescription adds the description text for a specified subcommand.
type Request ¶
type Request interface {
Context() context.Context
Param(string) string
PathParam(string) string
Bind(any) error
HostName() string
Params(string) []string
}
Request is an interface which is written because it allows us to create applications without being aware of the transport. In both cmd or server application, this abstraction can be used.
type Responder ¶
Responder is used by the application to provide output. This is implemented for both cmd and HTTP server application.
type RestPathOverrider ¶
type RestPathOverrider interface {
RestPath() string
}
type RouteGroup ¶ added in v0.2.0
type RouteGroup struct {
// contains filtered or unexported fields
}
RouteGroup is the public API for declaring routes and middleware within a group.
func (*RouteGroup) DELETE ¶ added in v0.2.0
func (g *RouteGroup) DELETE(pattern string, h Handler) *RouteGroup
DELETE registers a handler for HTTP DELETE on this group.
func (*RouteGroup) GET ¶ added in v0.2.0
func (g *RouteGroup) GET(pattern string, h Handler) *RouteGroup
GET registers a handler for HTTP GET on this group.
func (*RouteGroup) Group ¶ added in v0.2.0
func (g *RouteGroup) Group(prefix string, fns ...func(sub *RouteGroup)) *RouteGroup
Group creates or gets a child route group with the given prefix and returns it. An optional callback can be provided for backward-compatible inline registration.
func (*RouteGroup) PATCH ¶ added in v0.2.0
func (g *RouteGroup) PATCH(pattern string, h Handler) *RouteGroup
PATCH registers a handler for HTTP PATCH on this group.
func (*RouteGroup) POST ¶ added in v0.2.0
func (g *RouteGroup) POST(pattern string, h Handler) *RouteGroup
POST registers a handler for HTTP POST on this group.
func (*RouteGroup) PUT ¶ added in v0.2.0
func (g *RouteGroup) PUT(pattern string, h Handler) *RouteGroup
PUT registers a handler for HTTP PUT on this group.
func (*RouteGroup) Use ¶ added in v0.2.0
func (g *RouteGroup) Use(mws ...func(http.Handler) http.Handler) *RouteGroup
Use appends standard net/http middleware to this group. These run at the HTTP layer before the kite Handler is invoked.
func (*RouteGroup) UseMiddleware ¶ added in v0.2.0
func (g *RouteGroup) UseMiddleware(mws ...KiteMiddleware) *RouteGroup
UseMiddleware appends KiteMiddleware to this group. These run at the application layer with full *Context access.
type RouteRegistry ¶ added in v0.2.0
type RouteRegistry struct {
// contains filtered or unexported fields
}
RouteRegistry holds the root GroupNode and compiles the tree into chi routes.
type Span ¶
type Span struct {
TraceID string `json:"traceId"` // Trace ID of the span.
ID string `json:"id"` // ID of the span.
ParentID string `json:"parentId,omitempty"` // Parent ID of the span.
Name string `json:"name"` // Name of the span.
Timestamp int64 `json:"timestamp"` // Timestamp of the span.
Duration int64 `json:"duration"` // Duration of the span.
Tags map[string]string `json:"tags,omitempty"` // Tags associated with the span.
LocalEndpoint map[string]string `json:"localEndpoint"` // Local endpoint of the span.
}
Span represents a span that will be exported.
type SubscribeFunc ¶
type SubscriptionManager ¶
type SubscriptionManager struct {
// contains filtered or unexported fields
}
type TableNameOverrider ¶
type TableNameOverrider interface {
TableName() string
}
Source Files
¶
- auth.go
- cmd.go
- constants.go
- context.go
- cron.go
- cron_scheduler.go
- crud_handlers.go
- crud_helpers.go
- default.go
- exporter.go
- external_db.go
- factory.go
- grpc.go
- handler.go
- http_server.go
- kite.go
- metrics_server.go
- otel.go
- rbac.go
- request.go
- responder.go
- rest.go
- route_registry.go
- run.go
- shutdown.go
- subscriber.go
- swagger.go
- telemetry.go
- websocket.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cli
|
|
|
Package datasource contains all the supported data sources in Kite.
|
Package datasource contains all the supported data sources in Kite. |
|
file
Package file is a generated GoMock package.
|
Package file is a generated GoMock package. |
|
pubsub
Package pubsub provides a foundation for implementing pub/sub clients for various message brokers such as google pub-sub, kafka and MQTT.
|
Package pubsub provides a foundation for implementing pub/sub clients for various message brokers such as google pub-sub, kafka and MQTT. |
|
pubsub/google
Package google provides a client for interacting with Google Cloud Pub/Sub.This package facilitates interaction with Google Cloud Pub/Sub, allowing publishing and subscribing to topics, managing subscriptions, and handling messages.
|
Package google provides a client for interacting with Google Cloud Pub/Sub.This package facilitates interaction with Google Cloud Pub/Sub, allowing publishing and subscribing to topics, managing subscriptions, and handling messages. |
|
pubsub/kafka
Package kafka provides a client for interacting with Apache Kafka message queues.This package facilitates interaction with Apache Kafka, allowing publishing and subscribing to topics, managing consumer groups, and handling messages.
|
Package kafka provides a client for interacting with Apache Kafka message queues.This package facilitates interaction with Apache Kafka, allowing publishing and subscribing to topics, managing consumer groups, and handling messages. |
|
pubsub/mqtt
Package mqtt provides a client for interacting with MQTT message brokers.This package facilitates interaction with MQTT brokers, allowing publishing and subscribing to topics, managing subscriptions, and handling messages.
|
Package mqtt provides a client for interacting with MQTT message brokers.This package facilitates interaction with MQTT brokers, allowing publishing and subscribing to topics, managing subscriptions, and handling messages. |
|
redis
Package redis provides a client for interacting with Redis key-value stores.This package allows creating and managing Redis clients, executing Redis commands, and handling connections to Redis databases.
|
Package redis provides a client for interacting with Redis key-value stores.This package allows creating and managing Redis clients, executing Redis commands, and handling connections to Redis databases. |
|
sql
Package sql provides functionalities to interact with SQL databases using the database/sql package.This package includes a wrapper around sql.DB and sql.Tx to provide additional features such as query logging, metrics recording, and error handling.
|
Package sql provides functionalities to interact with SQL databases using the database/sql package.This package includes a wrapper around sql.DB and sql.Tx to provide additional features such as query logging, metrics recording, and error handling. |
|
sql/qb
Package qb provides SQL query builder utilities for dynamic WHERE/ORDER/GROUP/LIMIT style queries and bulk insert/update/delete statements.
|
Package qb provides SQL query builder utilities for dynamic WHERE/ORDER/GROUP/LIMIT style queries and bulk insert/update/delete statements. |
|
Package file provides unified access to various file operations, such as creating, reading, writing files across : - S3 - FTP - SFTP - Local FileSystem
|
Package file provides unified access to various file operations, such as creating, reading, writing files across : - S3 - FTP - SFTP - Local FileSystem |
|
Package grpc provides gRPC-related additions within the Kite framework.
|
Package grpc provides gRPC-related additions within the Kite framework. |
|
Package http provides a set of utilities for handling HTTP requests and responses within the Kite framework.
|
Package http provides a set of utilities for handling HTTP requests and responses within the Kite framework. |
|
middleware
Package middleware provides a collection of middleware functions that handles various aspects of request handling, such as authentication, logging, tracing, and metrics collection.
|
Package middleware provides a collection of middleware functions that handles various aspects of request handling, such as authentication, logging, tracing, and metrics collection. |
|
Package container provides a centralized structure to manage common application-level concerns such as logging, connection pools, and service management.
|
Package container provides a centralized structure to manage common application-level concerns such as logging, connection pools, and service management. |
|
Package logging provides logging functionalities for Kite applications.
|
Package logging provides logging functionalities for Kite applications. |
|
Package metrics provides functionalities for instrumenting Kite applications with metrics.
|
Package metrics provides functionalities for instrumenting Kite applications with metrics. |
|
Package migration is a generated GoMock package.
|
Package migration is a generated GoMock package. |
|
Package service provides an HTTP client with features for logging, metrics, and resilience.It supports various functionalities like health checks, circuit-breaker and various authentication.
|
Package service provides an HTTP client with features for logging, metrics, and resilience.It supports various functionalities like health checks, circuit-breaker and various authentication. |
|
Package websocket is a generated GoMock package.
|
Package websocket is a generated GoMock package. |