Documentation ¶
Index ¶
- type AppCtx
- type Config
- type Context
- func (c *Context) Add(env string, variable string, value string)
- func (c Context) FindVariableByEnv(env string, variable string) ContextVariable
- func (c Context) GetAllKeyValue(env string) map[string]string
- func (c Context) GetAllVariables(env string) core.StringSlice
- func (c Context) GetEnvsName() core.StringSlice
- func (c *Context) Remove(env string, variable string)
- type ContextVariable
- type MakeRequestData
- type Output
- func (out *Output) AddOrReplace(data MakeRequestData)
- func (out Output) Find(method string, url string) (MakeRequestData, error)
- func (out *Output) Remove(data MakeRequestData)
- func (out Output) SortDataAPIsByProjectName() ([]string, map[string][]MakeRequestData)
- func (out Output) UpdateMakeRequestData(values []MakeRequestData) Output
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppCtx ¶
type AppCtx struct { GetRootPrmt func() *tview.Pages AddListenerMRD map[string]func(data MakeRequestData) AddListenerConfig map[string]func(data Config) AddContextListener map[string]func(data Context) GetMDR func() MakeRequestData UpdateMDR func(data MakeRequestData) GetConfig func() Config UpdateConfig func(data Config) GetOutput func() Output UpdateContext func(data Context) RefreshViews func(views string) SwitchView func(view string) // contains filtered or unexported fields }
Event contains all events to manage application data
func NewAppCtx ¶
func NewAppCtx( getRootPrmt func() *tview.Pages, getMDR func() MakeRequestData, upMDR func(data MakeRequestData), getConfig func() Config, updateConfig func(data Config), getOutput func() Output, updateContext func(data Context), printOut func(level string, value string), refreshViews func(views string), switchView func(views string)) *AppCtx
NewEvent makes a new event struct
func (AppCtx) DisplayModal ¶
DisplayModal displays a model to the screen.
func (AppCtx) PrintDebug ¶
PrintDebug prints "debug" log to file
func (AppCtx) PrintError ¶
PrintError prints "error" log to file
func (AppCtx) PrintTrace ¶
PrintTrace prints "trace" log to file
type Context ¶
type Context struct {
Env map[string][]ContextVariable
}
Context reprensents a context structure
func (Context) FindVariableByEnv ¶
func (c Context) FindVariableByEnv(env string, variable string) ContextVariable
FindVariableByEnv finds variable for an specific environment
func (Context) GetAllKeyValue ¶
GetAllKeyValue gets all ContextVariable for an specific environment
func (Context) GetAllVariables ¶
func (c Context) GetAllVariables(env string) core.StringSlice
GetAllVariables returns all variables for an specific environment
func (Context) GetEnvsName ¶
func (c Context) GetEnvsName() core.StringSlice
GetEnvsName gets all environments name
type ContextVariable ¶
ContextVariable reprensents a context variable structure
func NewContextVariable ¶
func NewContextVariable(variable string, value string) ContextVariable
NewContextVariable creates new ContextVariable struct
type MakeRequestData ¶
type MakeRequestData struct { Method types.Method URL types.URL MapRequestHeaderKeyValue core.StringMap Body string ContentType string ProjectName string Alias string }
MakeRequestData reprensents a request structure
func EmptyMakeRequestData ¶
func EmptyMakeRequestData() MakeRequestData
EmptyMakeRequestData creates an empty new MakeRequestData struct
func NewMakeRequestData ¶
func NewMakeRequestData( method string, url string, header core.StringMap, body string, contentType string, projectName string, alias string) MakeRequestData
NewMakeRequestData creates a new MakeRequestData
func SimpleMakeRequestData ¶
func SimpleMakeRequestData( method string, url string, projectName string, alias string) MakeRequestData
SimpleMakeRequestData creates a simple new MakeRequestData
func (MakeRequestData) GetHTTPHeaderValues ¶
func (m MakeRequestData) GetHTTPHeaderValues() core.StringMap
GetHTTPHeaderValues filters by HTTP request header params
func (MakeRequestData) ToLog ¶
func (m MakeRequestData) ToLog(url types.URL) string
ToLog builds request to str message to be logged
func (MakeRequestData) TreeFormat ¶
func (m MakeRequestData) TreeFormat(pattern string) string
type Output ¶
type Output struct { Data []MakeRequestData Config Config Context Context }
Output struct corresponds to serialize and deserialize json app file
func (*Output) AddOrReplace ¶
func (out *Output) AddOrReplace(data MakeRequestData)
AddOrReplace adds or replaces a MakeRequestData struct
func (Output) Find ¶
func (out Output) Find(method string, url string) (MakeRequestData, error)
Find finds a MakeRequestData from "method"/"url"
func (*Output) Remove ¶
func (out *Output) Remove(data MakeRequestData)
Remove removes MakeRequestData struct
func (Output) SortDataAPIsByProjectName ¶
func (out Output) SortDataAPIsByProjectName() ([]string, map[string][]MakeRequestData)
SortDataAPIsByProjectName filters data APIs by project name and sorts by them
func (Output) UpdateMakeRequestData ¶
func (out Output) UpdateMakeRequestData(values []MakeRequestData) Output