Documentation ¶
Index ¶
- Variables
- func Register(name string, factory Factory)
- type Conf
- func (*Conf) Descriptor() ([]byte, []int)deprecated
- func (x *Conf) GetEndpoint() string
- func (x *Conf) GetKey() string
- func (x *Conf) GetLevel() int32
- func (x *Conf) GetLogGroupName() string
- func (x *Conf) GetPath() string
- func (x *Conf) GetProfile() string
- func (x *Conf) GetRegion() string
- func (x *Conf) GetSecret() string
- func (x *Conf) GetType() CoreType
- func (*Conf) ProtoMessage()
- func (x *Conf) ProtoReflect() protoreflect.Message
- func (x *Conf) Reset()
- func (x *Conf) String() string
- func (m *Conf) Validate() error
- func (m *Conf) ValidateAll() error
- type ConfMultiError
- type ConfValidationError
- type CoreType
- type Factory
- type Level
- type Logger
- type Registry
Constants ¶
This section is empty.
Variables ¶
var ( CoreType_name = map[int32]string{ 0: "Unkown", 1: "Stdout", 2: "File", 3: "Fluent", 4: "CloudWatch", 5: "AliYun", 6: "Sys", 7: "Hc", } CoreType_value = map[string]int32{ "Unkown": 0, "Stdout": 1, "File": 2, "Fluent": 3, "CloudWatch": 4, "AliYun": 5, "Sys": 6, "Hc": 7, } )
Enum value maps for CoreType.
var File_log_core_conf_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type Conf ¶ added in v0.0.39
type Conf struct { Type CoreType `protobuf:"varint,1,opt,name=type,proto3,enum=log.core.CoreType" json:"type,omitempty"` Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` Endpoint string `protobuf:"bytes,4,opt,name=endpoint,proto3" json:"endpoint,omitempty"` Key string `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"` Secret string `protobuf:"bytes,6,opt,name=secret,proto3" json:"secret,omitempty"` Region string `protobuf:"bytes,7,opt,name=region,proto3" json:"region,omitempty"` Profile string `protobuf:"bytes,8,opt,name=profile,proto3" json:"profile,omitempty"` LogGroupName string `protobuf:"bytes,9,opt,name=logGroupName,proto3" json:"logGroupName,omitempty"` // contains filtered or unexported fields }
func (*Conf) Descriptor
deprecated
added in
v0.0.39
func (*Conf) GetEndpoint ¶ added in v0.0.39
func (*Conf) GetLogGroupName ¶ added in v0.0.39
func (*Conf) GetProfile ¶ added in v0.0.39
func (*Conf) ProtoMessage ¶ added in v0.0.39
func (*Conf) ProtoMessage()
func (*Conf) ProtoReflect ¶ added in v0.0.39
func (x *Conf) ProtoReflect() protoreflect.Message
func (*Conf) Validate ¶ added in v0.0.39
Validate checks the field values on Conf with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Conf) ValidateAll ¶ added in v0.0.39
ValidateAll checks the field values on Conf with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConfMultiError, or nil if none found.
type ConfMultiError ¶ added in v0.0.39
type ConfMultiError []error
ConfMultiError is an error wrapping multiple validation errors returned by Conf.ValidateAll() if the designated constraints aren't met.
func (ConfMultiError) AllErrors ¶ added in v0.0.39
func (m ConfMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfMultiError) Error ¶ added in v0.0.39
func (m ConfMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfValidationError ¶ added in v0.0.39
type ConfValidationError struct {
// contains filtered or unexported fields
}
ConfValidationError is the validation error returned by Conf.Validate if the designated constraints aren't met.
func (ConfValidationError) Cause ¶ added in v0.0.39
func (e ConfValidationError) Cause() error
Cause function returns cause value.
func (ConfValidationError) Error ¶ added in v0.0.39
func (e ConfValidationError) Error() string
Error satisfies the builtin error interface
func (ConfValidationError) ErrorName ¶ added in v0.0.39
func (e ConfValidationError) ErrorName() string
ErrorName returns error name.
func (ConfValidationError) Field ¶ added in v0.0.39
func (e ConfValidationError) Field() string
Field function returns field value.
func (ConfValidationError) Key ¶ added in v0.0.39
func (e ConfValidationError) Key() bool
Key function returns key value.
func (ConfValidationError) Reason ¶ added in v0.0.39
func (e ConfValidationError) Reason() string
Reason function returns reason value.
type CoreType ¶ added in v0.0.39
type CoreType int32
func (CoreType) Descriptor ¶ added in v0.0.39
func (CoreType) Descriptor() protoreflect.EnumDescriptor
func (CoreType) EnumDescriptor
deprecated
added in
v0.0.39
func (CoreType) Number ¶ added in v0.0.39
func (x CoreType) Number() protoreflect.EnumNumber
func (CoreType) Type ¶ added in v0.0.39
func (CoreType) Type() protoreflect.EnumType
type Level ¶ added in v0.0.39
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel Level = iota - 1 // InfoLevel is the default logging priority. InfoLevel // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel // DPanicLevel logs are particularly important errors. In development the // logger panics after writing the message. DPanicLevel // PanicLevel logs a message, then panics. PanicLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel // InvalidLevel is an invalid value for Level. // // Core implementations may panic if they see messages of this level. InvalidLevel = _maxLevel + 1 )
type Logger ¶
func MustCreate ¶ added in v0.0.39
MustCreate instantiates a cores based on `discoveryDSN`.
type Registry ¶ added in v0.0.39
Registry is the interface for callers to get registered middleware.
func NewRegistry ¶ added in v0.0.39
func NewRegistry() Registry
NewRegistry returns a new middleware registry.