state

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: AGPL-3.0, AGPL-3.0-or-later Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

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

State stores anythin that you would store in memory

func NewState

func NewState(redisClient *redis.Client) *State

func (*State) CallerIdToNameSpace

func (s *State) CallerIdToNameSpace(callerId string) (string, error)

func (*State) Decrement

func (s *State) Decrement(token string) error

Decrement needs the token that's used for calls, not the token id

func (*State) DecrementBy

func (s *State) DecrementBy(token string, amt int64) error

func (*State) GetQuota

func (s *State) GetQuota(tokenId string) (int64, error)

Use at initialization

func (*State) IncrementBy

func (s *State) IncrementBy(tokenId string, amt int64) error

func (*State) IsUnderStartup

func (s *State) IsUnderStartup(author, projectName string) (bool, error)

func (*State) IsUp

func (s *State) IsUp(author, projectName string) (bool, error)

func (*State) LastCallIn

func (s *State) LastCallIn(author, projectName string, d time.Duration) (bool, error)

Returns wether you can use the service or has to start it

func (*State) MarkAsDown

func (s *State) MarkAsDown(author, projectName string) error

Use this to remove the service after stopping the container

func (*State) MarkAsNotUnderStartup

func (s *State) MarkAsNotUnderStartup(author, projectName string) error

Use this to remove the service after stopping the container

func (*State) MarkAsUnderStartup

func (s *State) MarkAsUnderStartup(author, projectName string) error

Use this to remove the service after stopping the container

func (*State) MarkAsUp

func (s *State) MarkAsUp(author, projectName string) error

Use this to remove the service after stopping the container

func (*State) Port

func (s *State) Port(author, projectName string) (int64, error)

func (*State) SetCallerIdToNameSpace

func (s *State) SetCallerIdToNameSpace(callerId, namespace string) error

func (*State) SetLastCall

func (s *State) SetLastCall(author, projectName string) error

Call this when proxying a request

func (*State) SetPort

func (s *State) SetPort(author, projectName string, port int) error

func (*State) SetQuota

func (s *State) SetQuota(tokenId string, quota int64) error

Use at initialization

Jump to

Keyboard shortcuts

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