Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterAuditLogServiceServer(s grpc.ServiceRegistrar, srv AuditLogServiceServer)
- type AuditLogEnvelope
- func (*AuditLogEnvelope) Descriptor() ([]byte, []int)deprecated
- func (x *AuditLogEnvelope) GetEvents() []*AuditLogEvent
- func (*AuditLogEnvelope) ProtoMessage()
- func (x *AuditLogEnvelope) ProtoReflect() protoreflect.Message
- func (x *AuditLogEnvelope) Reset()
- func (x *AuditLogEnvelope) String() string
- type AuditLogEvent
- func (*AuditLogEvent) Descriptor() ([]byte, []int)deprecated
- func (x *AuditLogEvent) GetAction() string
- func (x *AuditLogEvent) GetDiff() *structpb.Struct
- func (x *AuditLogEvent) GetId() string
- func (x *AuditLogEvent) GetNetworkId() string
- func (x *AuditLogEvent) GetOrigin() string
- func (x *AuditLogEvent) GetSource() *structpb.Struct
- func (x *AuditLogEvent) GetTarget() *structpb.Struct
- func (x *AuditLogEvent) GetTriggeredBy() string
- func (x *AuditLogEvent) GetTsMs() int64
- func (*AuditLogEvent) ProtoMessage()
- func (x *AuditLogEvent) ProtoReflect() protoreflect.Message
- func (x *AuditLogEvent) Reset()
- func (x *AuditLogEvent) String() string
- type AuditLogResponse
- func (*AuditLogResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AuditLogResponse) GetError() string
- func (x *AuditLogResponse) GetSuccess() bool
- func (*AuditLogResponse) ProtoMessage()
- func (x *AuditLogResponse) ProtoReflect() protoreflect.Message
- func (x *AuditLogResponse) Reset()
- func (x *AuditLogResponse) String() string
- type AuditLogServiceClient
- type AuditLogServiceServer
- type AuditLogService_StreamAuditLogsClient
- type AuditLogService_StreamAuditLogsServer
- type GrpcClient
- type UnimplementedAuditLogServiceServer
- type UnsafeAuditLogServiceServer
Constants ¶
const (
AuditLogService_StreamAuditLogs_FullMethodName = "/netmaker.auditlogs.AuditLogService/StreamAuditLogs"
)
const DefaultAuditBatchTime = 5 * time.Second
Variables ¶
var AuditLogService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "netmaker.auditlogs.AuditLogService", HandlerType: (*AuditLogServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "StreamAuditLogs", Handler: _AuditLogService_StreamAuditLogs_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "grpc/auditlogs/auditlogs.proto", }
AuditLogService_ServiceDesc is the grpc.ServiceDesc for AuditLogService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_grpc_auditlogs_auditlogs_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuditLogServiceServer ¶
func RegisterAuditLogServiceServer(s grpc.ServiceRegistrar, srv AuditLogServiceServer)
Types ¶
type AuditLogEnvelope ¶
type AuditLogEnvelope struct {
Events []*AuditLogEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
// contains filtered or unexported fields
}
* Envelope sent by the netmaker server containing multiple AuditLogEvents.
func (*AuditLogEnvelope) Descriptor
deprecated
func (*AuditLogEnvelope) Descriptor() ([]byte, []int)
Deprecated: Use AuditLogEnvelope.ProtoReflect.Descriptor instead.
func (*AuditLogEnvelope) GetEvents ¶
func (x *AuditLogEnvelope) GetEvents() []*AuditLogEvent
func (*AuditLogEnvelope) ProtoMessage ¶
func (*AuditLogEnvelope) ProtoMessage()
func (*AuditLogEnvelope) ProtoReflect ¶
func (x *AuditLogEnvelope) ProtoReflect() protoreflect.Message
func (*AuditLogEnvelope) Reset ¶
func (x *AuditLogEnvelope) Reset()
func (*AuditLogEnvelope) String ¶
func (x *AuditLogEnvelope) String() string
type AuditLogEvent ¶
type AuditLogEvent struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// Action performed (e.g. "CREATE", "UPDATE", "DELETE") — maps to schema.Action
Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"`
// Who initiated the action (maps to schema.Origin: "DASHBOARD", "API", "NMCTL", "CLIENT-APP")
Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"`
// User or entity that triggered the action
TriggeredBy string `protobuf:"bytes,4,opt,name=triggered_by,json=triggeredBy,proto3" json:"triggered_by,omitempty"`
// Network the event is scoped to (empty for global events)
NetworkId string `protobuf:"bytes,5,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"`
// Structured JSON blobs — map to datatypes.JSON fields in schema.Event
Source *structpb.Struct `protobuf:"bytes,6,opt,name=source,proto3" json:"source,omitempty"`
Target *structpb.Struct `protobuf:"bytes,7,opt,name=target,proto3" json:"target,omitempty"`
Diff *structpb.Struct `protobuf:"bytes,8,opt,name=diff,proto3" json:"diff,omitempty"`
// Timestamp (milliseconds since Unix epoch)
TsMs int64 `protobuf:"varint,9,opt,name=ts_ms,json=tsMs,proto3" json:"ts_ms,omitempty"`
// contains filtered or unexported fields
}
* Audit log event generated by the netmaker server. Mirrors the schema.Event struct.
func (*AuditLogEvent) Descriptor
deprecated
func (*AuditLogEvent) Descriptor() ([]byte, []int)
Deprecated: Use AuditLogEvent.ProtoReflect.Descriptor instead.
func (*AuditLogEvent) GetAction ¶
func (x *AuditLogEvent) GetAction() string
func (*AuditLogEvent) GetDiff ¶
func (x *AuditLogEvent) GetDiff() *structpb.Struct
func (*AuditLogEvent) GetId ¶
func (x *AuditLogEvent) GetId() string
func (*AuditLogEvent) GetNetworkId ¶
func (x *AuditLogEvent) GetNetworkId() string
func (*AuditLogEvent) GetOrigin ¶
func (x *AuditLogEvent) GetOrigin() string
func (*AuditLogEvent) GetSource ¶
func (x *AuditLogEvent) GetSource() *structpb.Struct
func (*AuditLogEvent) GetTarget ¶
func (x *AuditLogEvent) GetTarget() *structpb.Struct
func (*AuditLogEvent) GetTriggeredBy ¶
func (x *AuditLogEvent) GetTriggeredBy() string
func (*AuditLogEvent) GetTsMs ¶
func (x *AuditLogEvent) GetTsMs() int64
func (*AuditLogEvent) ProtoMessage ¶
func (*AuditLogEvent) ProtoMessage()
func (*AuditLogEvent) ProtoReflect ¶
func (x *AuditLogEvent) ProtoReflect() protoreflect.Message
func (*AuditLogEvent) Reset ¶
func (x *AuditLogEvent) Reset()
func (*AuditLogEvent) String ¶
func (x *AuditLogEvent) String() string
type AuditLogResponse ¶
type AuditLogResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
* Response from the exporter acknowledging receipt of a batch.
func (*AuditLogResponse) Descriptor
deprecated
func (*AuditLogResponse) Descriptor() ([]byte, []int)
Deprecated: Use AuditLogResponse.ProtoReflect.Descriptor instead.
func (*AuditLogResponse) GetError ¶
func (x *AuditLogResponse) GetError() string
func (*AuditLogResponse) GetSuccess ¶
func (x *AuditLogResponse) GetSuccess() bool
func (*AuditLogResponse) ProtoMessage ¶
func (*AuditLogResponse) ProtoMessage()
func (*AuditLogResponse) ProtoReflect ¶
func (x *AuditLogResponse) ProtoReflect() protoreflect.Message
func (*AuditLogResponse) Reset ¶
func (x *AuditLogResponse) Reset()
func (*AuditLogResponse) String ¶
func (x *AuditLogResponse) String() string
type AuditLogServiceClient ¶
type AuditLogServiceClient interface {
StreamAuditLogs(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AuditLogEnvelope, AuditLogResponse], error)
}
AuditLogServiceClient is the client API for AuditLogService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
* Bidirectional streaming:
- Netmaker server continuously sends AuditLogEnvelope batches.
- Exporter replies with AuditLogResponse ACKs.
func NewAuditLogServiceClient ¶
func NewAuditLogServiceClient(cc grpc.ClientConnInterface) AuditLogServiceClient
type AuditLogServiceServer ¶
type AuditLogServiceServer interface {
StreamAuditLogs(grpc.BidiStreamingServer[AuditLogEnvelope, AuditLogResponse]) error
// contains filtered or unexported methods
}
AuditLogServiceServer is the server API for AuditLogService service. All implementations must embed UnimplementedAuditLogServiceServer for forward compatibility.
* Bidirectional streaming:
- Netmaker server continuously sends AuditLogEnvelope batches.
- Exporter replies with AuditLogResponse ACKs.
type AuditLogService_StreamAuditLogsClient ¶
type AuditLogService_StreamAuditLogsClient = grpc.BidiStreamingClient[AuditLogEnvelope, AuditLogResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AuditLogService_StreamAuditLogsServer ¶
type AuditLogService_StreamAuditLogsServer = grpc.BidiStreamingServer[AuditLogEnvelope, AuditLogResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type GrpcClient ¶
type GrpcClient struct {
// contains filtered or unexported fields
}
func Client ¶
func Client() *GrpcClient
func NewAuditLogsGrpcClient ¶
func NewAuditLogsGrpcClient(serverAddr string, optFns ...func(*options.Options)) *GrpcClient
func (*GrpcClient) Export ¶
func (c *GrpcClient) Export(event *AuditLogEvent) error
func (*GrpcClient) Start ¶
func (c *GrpcClient) Start() error
func (*GrpcClient) Stop ¶
func (c *GrpcClient) Stop() error
type UnimplementedAuditLogServiceServer ¶
type UnimplementedAuditLogServiceServer struct{}
UnimplementedAuditLogServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedAuditLogServiceServer) StreamAuditLogs ¶
func (UnimplementedAuditLogServiceServer) StreamAuditLogs(grpc.BidiStreamingServer[AuditLogEnvelope, AuditLogResponse]) error
type UnsafeAuditLogServiceServer ¶
type UnsafeAuditLogServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAuditLogServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuditLogServiceServer will result in compilation errors.