sync_stack

package module
v0.0.0-...-d3f1a78 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

type Stack interface {
	Len() int
	Push(interface{})
	Pop() (interface{}, error)
	Clear()
}

type SyncStack

type SyncStack struct {
	// contains filtered or unexported fields
}

func Create

func Create() *SyncStack

func (*SyncStack) Clear

func (*SyncStack) Clear()

func (SyncStack) Len

func (s SyncStack) Len() int

Len returns the number of elements in the stack.

func (*SyncStack) Pop

func (s *SyncStack) Pop() (interface{}, error)

Pop removes the top element from the stack and returns it. If the stack is empty then this function will return nil.

func (*SyncStack) Push

func (s *SyncStack) Push(v interface{})

Push pushes a new element on to the stack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL