history

package
v0.0.0-...-2d91a95 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SuccessSuffix is a constanta for ...
	SuccessSuffix = config.HISTORY_TAG + "__y"
	// FailureSuffix is a constanta for ...
	FailureSuffix = config.HISTORY_TAG + "__n"
	// SuccessFile is a constanta for ...
	SuccessFile = config.HISTORY_DIR + "/" + SuccessSuffix
	// FailureFile is a constanta for ...
	FailureFile = config.HISTORY_DIR + "/" + FailureSuffix
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Failure

type Failure struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Failure is a struct failed record

func (*Failure) DeleteFailure

func (failure *Failure) DeleteFailure(req *request.Request)

DeleteFailure is a function for delete the failed record

func (*Failure) PullFailure

func (failure *Failure) PullFailure() map[string]*request.Request

PullFailure is a funtion for pull a failed record

func (*Failure) UpsertFailure

func (failure *Failure) UpsertFailure(req *request.Request) bool

UpsertFailure update or join a failed record, contrast is already there, there is no record, The return value indicates whether there is an insert operation.

type Historier

type Historier interface {
	ReadSuccess(provider string, inherit bool) // Read the success record
	UpsertSuccess(string) bool                 // Update or join success records
	HasSuccess(string) bool                    // Check if there is a successful record
	DeleteSuccess(string)                      // Delete the success record
	FlushSuccess(provider string)              // I/O output is successfully logged, but unclear cache

	ReadFailure(provider string, inherit bool) // Remove the failed record
	PullFailure() map[string]*request.Request  // Pull the failed record and empty it
	UpsertFailure(*request.Request) bool       // Update or join a failed record
	DeleteFailure(*request.Request)            // Delete the failed record
	FlushFailure(provider string)              // I/O output failed to record, but unclear cache

	Empty() // Clear the cache, but not output
}

Historier is interface for history

func New

func New(name string, subName string) Historier

New is function for create new historier

type History

type History struct {
	*Success
	*Failure

	sync.RWMutex
	// contains filtered or unexported fields
}

History is interface for history

func (*History) Empty

func (history *History) Empty()

Empty is a funtion for clear cache, but not output

func (*History) FlushFailure

func (history *History) FlushFailure(provider string)

FlushFailure is a function for flush. I/O output failed record, but unclear cache

func (*History) FlushSuccess

func (history *History) FlushSuccess(provider string)

FlushSuccess is a function for flush. I/O output is successfully recorded, but unclear cache

func (*History) ReadFailure

func (history *History) ReadFailure(provider string, inherit bool)

ReadFailure is a function for remove the failed record

func (*History) ReadSuccess

func (history *History) ReadSuccess(provider string, inherit bool)

ReadSuccess is function for read the success record

type Success

type Success struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Success is a struct success history

func (*Success) DeleteSuccess

func (success *Success) DeleteSuccess(reqUnique string)

DeleteSuccess is a function for delete the success record

func (*Success) HasSuccess

func (success *Success) HasSuccess(reqUnique string) bool

HasSuccess is a function for check a successful record,

func (*Success) UpsertSuccess

func (success *Success) UpsertSuccess(reqUnique string) bool

UpsertSuccess is a function for update or join a successful record, Contrast is already there, there is no record, The return value indicates whether there is an insert operation.

Jump to

Keyboard shortcuts

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