stringscacheapp

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(ctx context.Context, c Config) (stop func())

Main creates and runs StringsCache app. It returns stop function when app is ready.

Types

type Config

type Config struct {
	Address               string
	StringsServiceAddress string
}

Config is a set of options for StringsCache app.

type Service

type Service struct {
	scpb.UnimplementedStringsCacheServiceServer
	// contains filtered or unexported fields
}

Service is a StringsCache app.

func NewService

func NewService(address string, stringsAddress string) *Service

NewService creates new StringsCache app.

func (*Service) Invalidate

Invalidate clears cache.

func (*Service) Ready

func (s *Service) Ready() <-chan struct{}

Ready returns a channel that is closed when service is ready.

func (*Service) Reverse

func (s *Service) Reverse(ctx context.Context, req *scpb.Message) (*scpb.Message, error)

Reverse a string. Makes a request to StringsService unless request is cached.

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

Run runs server. It does not return until ctx is done or error is encountered.

Jump to

Keyboard shortcuts

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