Skip to content

Commit

Permalink
refactor(gounter): delete some interface
Browse files Browse the repository at this point in the history
  • Loading branch information
gemone committed Jan 28, 2023
1 parent ce8b616 commit 2e1269d
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions gcounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type CounterType byte

const (
// CounterNormal Normal Counter
CounterNormal CounterType = iota
// CounterWithMax Max Counter
CounterNormal CounterType = iota // CounterWithMax Max Counter
CounterWithMax
// CounterWithLabel Label Counter
CounterWithLabel
Expand All @@ -15,7 +14,6 @@ const (

type Gounter interface {
Get() float64
Real() float64
Label() CounterType

Reset()
Expand All @@ -25,18 +23,14 @@ type Gounter interface {
Inc() bool
Dec() bool

// Can returns will Gounter continue work.
Can() bool

CopyTo(Gounter) (bool, error)
}

// WithLabel gounter with label
type WithLabel interface {
// LabelGounter gounter with label
type LabelGounter interface {
Label() CounterType

Get(string) (float64, Gounter)
Real(string) (float64, Gounter)

Reset()
ResetLabel(string)
Expand All @@ -46,9 +40,6 @@ type WithLabel interface {
Inc(string) (bool, Gounter)
Dec(string) (bool, Gounter)

Can() bool
CanLabel(string) bool

// Based on the map feature,
// replication should not be accepted. (CopyTo)
}

0 comments on commit 2e1269d

Please sign in to comment.