utils

package
v0.0.0-...-ce8e928 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 4 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[T any] struct {
	S []T // Slice
	// contains filtered or unexported fields
}

Using Generics to define Type in Stake to Use Structs, too.

func NewStack

func NewStack[T any]() *Stack[T]

func (*Stack[T]) Length

func (stack *Stack[T]) Length() int

func (*Stack[T]) Peek

func (stack *Stack[T]) Peek() (T, error)

func (*Stack[T]) Pop

func (stack *Stack[T]) Pop() (T, error)

func (*Stack[T]) Push

func (stack *Stack[T]) Push(element T)

type SubModel

type SubModel interface {
	tea.Model

	// Init is the first function that will be called. It returns an optional
	// initial command. To not perform an initial command return nil.
	Init() tea.Cmd

	// Update is called when a message is received. Use it to inspect messages
	// and, in response, update the model and/or send a command.
	DoUpdate(tea.Msg, *data.StateBag) (SubModel, tea.Cmd)

	// RenderView renders the program's UI, which is just a string. The view is
	// rendered after every Update.
	RenderView(*data.StateBag) string
}

Jump to

Keyboard shortcuts

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