api

package
v0.0.0-...-1cb680b Latest Latest
Warning

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

Go to latest
Published: May 4, 2016 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrSectionNotFound = err("Section not found")
	ErrStackIsEmpty    = err("Section is empty")
)

Commond non-system error

Variables

This section is empty.

Functions

This section is empty.

Types

type DataResult

type DataResult struct {
	Message        // Message content
	DepthIndex int // Current stack depth (before operation) - non-atomic op.
}

DataResult - result of PUSH and PEAK operation

type Message

type Message struct {
	Headers map[string]string // Headers are decoded to JSON (may be changed in future)
	Body    []byte
}

Message represenation in stack

type PushArgs

type PushArgs struct {
	Message        // Message content
	Section string // Stack name
}

PushArgs - arguments for PUSH operation

type Section

type Section struct {
	Name       string
	Depth      int
	LastAccess time.Time
}

Section (stack) basic info

type Service

type Service interface {
	Sections(prefix string, result *[]Section) error
	Push(msg PushArgs, resultDepthIndex *int) error
	Peak(section string, result *DataResult) error
	Pop(section string, result *DataResult) error
}

Service API

Jump to

Keyboard shortcuts

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