Documentation
¶
Index ¶
- Constants
- Variables
- func CanAccessPath(requestPath string, caps []Capabilities, accessType string) bool
- func CheckRequestPermissions(localClient *tailscale.LocalClient, r *http.Request, accessType string) (*apitype.WhoIsResponse, string, error)
- func CheckRequestPermissionsHandler(localClient *tailscale.LocalClient, accessType string, handler http.Handler) http.Handler
- func GetValueByPath(store map[string]interface{}, requestPath string) (interface{}, error)
- type ACLMiddleware
- type Capabilities
Constants ¶
View Source
const ( WhoisKey contextKey = "whois" RemoteIPKey contextKey = "remoteIP" )
View Source
const PeerCapName = "github.com/josh/datajar-server"
Variables ¶
View Source
var MetricsHandler = promhttp.HandlerFor( MetricsRegistry, promhttp.HandlerOpts{}, )
View Source
var MetricsRegistry = prometheus.NewRegistry()
View Source
var ReadsTotal = promauto.With(MetricsRegistry).NewCounterVec( prometheus.CounterOpts{ Name: "datajar_reads_total", Help: "Tracks the number of Data Jar reads.", }, []string{"hostname", "ip", "path"}, )
View Source
prometheus.CounterOpts{ Name: "datajar_unauthorized_total", Help: "Tracks the number of unauthorized Data Jar requests.", }, []string{"hostname", "ip", "path"}, )
View Source
var WritesTotal = promauto.With(MetricsRegistry).NewCounterVec( prometheus.CounterOpts{ Name: "datajar_writes_total", Help: "Tracks the number of Data Jar writes.", }, []string{"hostname", "ip", "path"}, )
Functions ¶
func CanAccessPath ¶
func CanAccessPath(requestPath string, caps []Capabilities, accessType string) bool
func CheckRequestPermissions ¶
func CheckRequestPermissions(localClient *tailscale.LocalClient, r *http.Request, accessType string) (*apitype.WhoIsResponse, string, error)
func GetValueByPath ¶
Given a HTTP request path, traverse the store and return the value at that path.
Types ¶
type ACLMiddleware ¶
type ACLMiddleware struct {
// contains filtered or unexported fields
}
func (*ACLMiddleware) ServeHTTP ¶
func (m *ACLMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Capabilities ¶
Click to show internal directories.
Click to hide internal directories.