localEnvironment

package
v0.0.0-...-6f7e320 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTestEnv

func IsTestEnv() bool

func ValidateToken

func ValidateToken(token string) error

Types

type LocalEnvironment

type LocalEnvironment struct {
	UserStorage       map[string]*models.User
	PrStorage         map[string][]*models.PR
	EventTraceStorage []*models.Event
	IsTestEnv         bool
	TokenManager      TokenManager
	// contains filtered or unexported fields
}

func GetEnv

func GetEnv() *LocalEnvironment

thread safe

func (*LocalEnvironment) AddEvent

func (this *LocalEnvironment) AddEvent(elem *models.Event)

func (*LocalEnvironment) AddEventSafe

func (this *LocalEnvironment) AddEventSafe(elem *models.Event)

thread safe

func (*LocalEnvironment) ClearEventTracer

func (this *LocalEnvironment) ClearEventTracer()

func (*LocalEnvironment) ClearPrStorage

func (this *LocalEnvironment) ClearPrStorage()

func (*LocalEnvironment) ClearUserStorage

func (this *LocalEnvironment) ClearUserStorage()

func (*LocalEnvironment) GetAllEvents

func (this *LocalEnvironment) GetAllEvents() *[]*models.Event

func (*LocalEnvironment) GetPrStorage

func (this *LocalEnvironment) GetPrStorage() *map[string][]*models.PR

func (*LocalEnvironment) GetResty

func (this *LocalEnvironment) GetResty(name string) *resty.Client

func (*LocalEnvironment) GetUserStorage

func (this *LocalEnvironment) GetUserStorage() *map[string]*models.User

type LocalToken

type LocalToken struct{}

implementation, save token in environment variables

func (*LocalToken) Get

func (this *LocalToken) Get() string

func (*LocalToken) HasToken

func (this *LocalToken) HasToken() bool

func (*LocalToken) LoadTokenFromClipboard

func (this *LocalToken) LoadTokenFromClipboard() error

func (*LocalToken) Set

func (this *LocalToken) Set(token string) error

type MockedToken

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

mock implementation, just use por test

func (*MockedToken) Get

func (this *MockedToken) Get() string

func (*MockedToken) HasToken

func (this *MockedToken) HasToken() bool

func (*MockedToken) Set

func (this *MockedToken) Set(token string) error

type TokenManager

type TokenManager interface {
	Get() string
	Set(token string) error
	HasToken() bool
}

interface

Jump to

Keyboard shortcuts

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