audit

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 16 Imported by: 5

Documentation

Overview

Copyright (c) 2016 Couchbase, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var AuditPutCommandCode = mc.CommandCode(0x27)

opcode for memcached audit command

View Source
var PoolClients = 5
View Source
var ReadTimeout = 1000 * time.Millisecond

read timeout

View Source
var WriteTimeout = 1000 * time.Millisecond

write timeout

Functions

func GetNewConnection

func GetNewConnection(kvAddr string) (*mcc.Client, error)

Types

type AuditSvc

type AuditSvc struct {
	// contains filtered or unexported fields
}

func NewAuditSvc

func NewAuditSvc(uri string) (*AuditSvc, error)

func (*AuditSvc) GetNonPoolClient

func (service *AuditSvc) GetNonPoolClient() (*mcc.Client, error)

Get a new connection that is not part of the general pool. The caller is responsible for its management.

func (*AuditSvc) Write

func (service *AuditSvc) Write(eventId uint32, event interface{}) error

func (*AuditSvc) WriteUsingNonPoolClient

func (service *AuditSvc) WriteUsingNonPoolClient(client *mcc.Client, eventId uint32,
	event interface{}) error

type CommonAuditFields

type CommonAuditFields struct {
	GenericFields

	Local  *addressFields `json:"local,omitempty"`
	Remote *addressFields `json:"remote,omitempty"`
}

func GetCommonAuditFields

func GetCommonAuditFields(req *http.Request) CommonAuditFields

type GenericFields

type GenericFields struct {
	Timestamp  string     `json:"timestamp"`
	RealUserid RealUserId `json:"real_userid"`
}

func GetAuditBasicFields

func GetAuditBasicFields(req *http.Request) GenericFields

type RealUserId

type RealUserId struct {
	Domain   string `json:"domain"`
	Username string `json:"user"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL