file

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToFile

func AppendToFile(fileName string, newText string) error

AppendToFile append text to file after new line

func ReadFromFile

func ReadFromFile(fileName string) ([]string, error)

ReadFromFile read text to file return array of string (array represent the line number in file)

func WriteToFile

func WriteToFile(fileName string, text string) error

WriteToFile write text to file

Types

type EventMirroringToFileService

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

EventMirroringToFileService implementor of event mirroring service which stores to file

func NewEventMirroringToFileService

func NewEventMirroringToFileService(
	fileName string,
	serviceName string,
	pubsubTopics map[string]*pubsub.Topic,
	notifier notifier.Notifier,
) *EventMirroringToFileService

NewEventMirroringToFileService build new event mirroring to file services object

func (*EventMirroringToFileService) Acknowledge

func (s *EventMirroringToFileService) Acknowledge(ctx *context.Context, event *event.Event) *types.Error

Acknowledge acknowledge / remove event from file by idempotentId

func (*EventMirroringToFileService) Consume

func (s *EventMirroringToFileService) Consume(ctx *context.Context, topicName string) (*event.Event, *types.Error)

Consume consume event from file with return the first event from file

func (*EventMirroringToFileService) IsExist

func (s *EventMirroringToFileService) IsExist(ctx *context.Context, event *event.Event) bool

IsExist check whether the event is exist in file

func (*EventMirroringToFileService) Publish

Publish publish event with mirroring in file

Jump to

Keyboard shortcuts

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