Skip to content

Commit

Permalink
Extract rt types (#8)
Browse files Browse the repository at this point in the history
* Extract runtime types

Co-authored-by: ZenGround0 <[email protected]>
  • Loading branch information
ZenGround0 and ZenGround0 authored Sep 10, 2020
1 parent 001afac commit bbd537e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cbor/cbor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cbor

import "io"

// These interfaces are intended to match those from whyrusleeping/cbor-gen, such that code generated from that
// system is automatically usable here (but not mandatory).
type Marshaler interface {
MarshalCBOR(w io.Writer) error
}

type Unmarshaler interface {
UnmarshalCBOR(r io.Reader) error
}

type Er interface {
Marshaler
Unmarshaler
}
18 changes: 18 additions & 0 deletions rt/log.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package log

// Specifies importance of message, LogLevel numbering is consistent with the uber-go/zap package.
type LogLevel int

const (
// DebugLevel logs are typically voluminous, and are usually disabled in
// production.
DEBUG LogLevel = iota - 1
// InfoLevel is the default logging priority.
INFO
// WarnLevel logs are more important than Info, but don't need individual
// human review.
WARN
// ErrorLevel logs are high-priority. If an application is running smoothly,
// it shouldn't generate any error-level logs.
ERROR
)

0 comments on commit bbd537e

Please sign in to comment.