github.com/fern4lvarez/piladb@v0.2.0-alpha.20180407/pkg/stack/stacker.go (about)

     1  package stack
     2  
     3  // Stacker represents an interface that contains all the
     4  // required methods to implement a Stack that can be
     5  // used in piladb.
     6  type Stacker interface {
     7  	// Push an element into a Stack
     8  	Push(element interface{})
     9  	// Pop the topmost element of a Stack
    10  	Pop() (interface{}, bool)
    11  	// Base bases a new element at the bottom of the Stack
    12  	Base(element interface{})
    13  	// Sweep the bottommost element of a Stack
    14  	Sweep() (interface{}, bool)
    15  	// SweepPush sweeps the bottommost element of a Stack
    16  	// and pushes another on top
    17  	SweepPush(element interface{}) (interface{}, bool)
    18  	// Rotate the bottommost element of a Stack to the top
    19  	Rotate() bool
    20  	// Size returns the size of the Stack
    21  	Size() int
    22  	// Peek returns the topmost element of the Stack
    23  	Peek() interface{}
    24  	// Flush flushes a Stack
    25  	Flush()
    26  }