storedProc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParamAliasRcd

type ParamAliasRcd struct {
	Name  string
	Alias string
}

type ParamPlacementRcd

type ParamPlacementRcd struct {
	Name      string
	Placement string
}

type PreparedCallStatements

type PreparedCallStatements struct {
	ResponseFormat         map[string]any
	InOutParams            []any // to send values to SP call
	InOutParamVariables    map[string]*any
	InOutParamMapToSPParam map[string]*StoredProcParamter
	FinalCallStatement     string
}

type PromotionRecord

type PromotionRecord struct {
	Rowid           string
	Action          string // D: Delete   R:Refresh   I:Insert
	Endpoint        string
	Storedproc      string
	Storedproclib   string
	Httpmethod      string
	UseSpecificName string
	UseWithoutAuth  string
	ParamAlias      string
	ParamAliasRcds  []*ParamAliasRcd

	ParamPlacement     string
	ParamPlacementRcds []*ParamPlacementRcd

	Namespace string

	Status              string
	StatusMessage       string
	validator.Validator `json:"-" db:"-" form:"-"`
}

func (*PromotionRecord) BreakParamAlias

func (p *PromotionRecord) BreakParamAlias()

func (*PromotionRecord) BreakParamPlacements

func (p *PromotionRecord) BreakParamPlacements()

type ServerRecord

type ServerRecord struct {
	ID   string `json:"id" db:"id" form:"id"`
	Name string `json:"server_name" db:"server_name" form:"name"`
}

type StoredProc

type StoredProc struct {
	ID           string `json:"id" db:"id" form:"id"`
	EndPointName string `json:"endpointname" db:"endpointname" form:"endpointname"`
	HttpMethod   string `json:"httpmethod" db:"httpmethod" form:"httpmethod"`

	Name            string                `json:"name" db:"name" form:"name"`
	Lib             string                `json:"lib" db:"lib" form:"lib"`
	SpecificName    string                `json:"specificname" db:"specificname" form:"specificname"`
	SpecificLib     string                `json:"specificlib" db:"specificlib" form:"specificlib"`
	UseSpecificName bool                  `json:"usespecificname" db:"usespecificname" form:"usespecificname"`
	CallStatement   string                `json:"callstatement" db:"callstatement" form:"-"`
	Parameters      []*StoredProcParamter `json:"params" db:"params" form:"-"`
	ResultSets      int                   `json:"resultsets" db:"resultsets" form:"-"`
	ResponseFormat  string                `json:"responseformat" db:"responseformat" form:"-"`

	DefaultServerId    string          `json:"-" db:"-" form:"serverid"`
	DefaultServer      *ServerRecord   `json:"dserverid" db:"dserverid" form:"-"`
	AllowedOnServers   []*ServerRecord `json:"allowedonservers" db:"allowedonservers" form:"allowedonservers"`
	MockUrl            string          `json:"mockurl" db:"mockurl" form:"-"`
	MockUrlWithoutAuth string          `json:"mockurlnoa" db:"mockurlnoa" form:"-"`

	InputPayload        string                     `json:"inputpayload" db:"inputpayload" form:"inputpayload"`
	validator.Validator `json:"-" db:"-" form:"-"` // this contains the fielderror

	AllowWithoutAuth bool `json:"awoauth" db:"awoauth" form:"awoauth"`

	DataAccess string `json:"dataaccess" db:"dataaccess" form:"dataaccess"`

	Modified string `json:"modified" db:"modified" form:"modified"`

	UseNamedParams bool `json:"useunnamedparams" db:"useunnamedparams" form:"-"`

	Promotionsql string `json:"promotionsql" db:"promotionsql" form:"-"`

	HtmlTemplate string `json:"htmltemplate" db:"htmltemplate" form:"htmltemplate"`
	Namespace    string `json:"namespace" db:"namespace" form:"namespace"`

	IsSpecial     bool `json:"isspecial" db:"isspecial" form:"-"`
	MaxlogEntries int  `json:"maxlogentries" db:"maxlogentries" form:"maxlogentries"`
}

func (*StoredProc) AddAllowedServer

func (s *StoredProc) AddAllowedServer(serverID, serverName string)

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) AssignAliasForPathPlacement

func (s *StoredProc) AssignAliasForPathPlacement()

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) AvailableParamterPostions

func (s *StoredProc) AvailableParamterPostions() []string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) BuildMockUrl

func (s *StoredProc) BuildMockUrl()

------------------------------------------------------------ BuildMockUrl(s) ------------------------------------------------------------

func (*StoredProc) BuildMockUrlGET

func (s *StoredProc) BuildMockUrlGET()

------------------------------------------------------------ BuildMockUrl(s) ------------------------------------------------------------

func (*StoredProc) BuildMockUrlPost

func (s *StoredProc) BuildMockUrlPost()

------------------------------------------------------------ BuildMockUrl(s) ------------------------------------------------------------

func (*StoredProc) BuildMockUrlXX

func (s *StoredProc) BuildMockUrlXX()

------------------------------------------------------------ BuildMockUrl(s) ------------------------------------------------------------

func (*StoredProc) DeleteAllowedServer

func (s *StoredProc) DeleteAllowedServer(serverID string)

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) EPDetailUrl

func (s *StoredProc) EPDetailUrl() template.HTML

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) EPHander

func (s *StoredProc) EPHander() string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) EPID

func (s *StoredProc) EPID() string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) EPMaxLogEntries

func (s *StoredProc) EPMaxLogEntries() int

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) EPMethod

func (s *StoredProc) EPMethod() string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) EPName

func (s *StoredProc) EPName() string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) EPNameSpace

func (s *StoredProc) EPNameSpace() string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) EPServerId

func (s *StoredProc) EPServerId() string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) EPType

func (s *StoredProc) EPType() string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) GetNamespace

func (s *StoredProc) GetNamespace() string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) IsAllowedForServer

func (s *StoredProc) IsAllowedForServer(serverID string) bool

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) LogImage

func (s *StoredProc) LogImage() string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) SetNameSpace

func (s *StoredProc) SetNameSpace()

------------------------------------------------------------ set name space value ------------------------------------------------------------

func (*StoredProc) Slug

func (s *StoredProc) Slug() string

------------------------------------------------------------

------------------------------------------------------------

func (*StoredProc) ValidateAlias

func (s *StoredProc) ValidateAlias() error

------------------------------------------------------------

------------------------------------------------------------

type StoredProcParamter

type StoredProcParamter struct {
	Position           int
	Mode               string // in out inout
	Name               string
	Alias              string // alias to original name
	Datatype           string //todo list all avaialble data types
	Scale              int
	Precision          int
	MaxLength          int
	DefaultValue       sql.NullString
	GlobalVariableName string
	CreateStatement    string
	DropStatement      string
	GivenValue         string
	OutValue           string
	Placement          string // query  path body
	ValidatorRegex     string
	// contains filtered or unexported fields
}

func (*StoredProcParamter) CheckValidatorRegex

func (p *StoredProcParamter) CheckValidatorRegex(regexMap map[string]string) error

-----------------------------------------------------------------

To add more validation  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

-----------------------------------------------------------------

func (*StoredProcParamter) ConvertOUTVarToType

func (p *StoredProcParamter) ConvertOUTVarToType(v *any) (any, error)

-----------------------------------------------------------------

-----------------------------------------------------------------

func (*StoredProcParamter) ConvertToType

func (p *StoredProcParamter) ConvertToType(v any) (any, error)

-----------------------------------------------------------------

-----------------------------------------------------------------

func (*StoredProcParamter) GetDefaultValueX

func (p *StoredProcParamter) GetDefaultValueX() string

-----------------------------------------------------------------

-----------------------------------------------------------------

func (*StoredProcParamter) GetNameToUse

func (p *StoredProcParamter) GetNameToUse(ignoreSpecials bool) string

-----------------------------------------------------------------

-----------------------------------------------------------------

func (*StoredProcParamter) GetValidatorRegex

func (p *StoredProcParamter) GetValidatorRegex(regexMap map[string]string) (*regexp.Regexp, error)

-----------------------------------------------------------------

-----------------------------------------------------------------

func (*StoredProcParamter) HasValidValue

func (p *StoredProcParamter) HasValidValue(val any, regexMap map[string]string) error

-----------------------------------------------------------------

To add more validation  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

-----------------------------------------------------------------

func (*StoredProcParamter) IsInt

func (p *StoredProcParamter) IsInt() bool

-----------------------------------------------------------------

-----------------------------------------------------------------

func (*StoredProcParamter) IsNumeric

func (p *StoredProcParamter) IsNumeric() bool

-----------------------------------------------------------------

-----------------------------------------------------------------

func (*StoredProcParamter) IsString

func (p *StoredProcParamter) IsString() bool

-----------------------------------------------------------------

-----------------------------------------------------------------

func (*StoredProcParamter) NeedQuote

func (p *StoredProcParamter) NeedQuote(value string) bool

-----------------------------------------------------------------

-----------------------------------------------------------------

func (*StoredProcParamter) ValidatorValueByRegex

func (p *StoredProcParamter) ValidatorValueByRegex(val string, regexMap map[string]string) bool

-----------------------------------------------------------------

-----------------------------------------------------------------

type StoredProcResponse

type StoredProcResponse struct {
	ReferenceId string
	Status      int
	Message     string
	Data        map[string]any
	LogData     []*logger.LogEvent `json:"-" db:"-" form:"-"`
}

type UserTokenSyncRecord

type UserTokenSyncRecord struct {
	Rowid               string
	Username            string // D: Delete   R:Refresh   I:Insert
	Token               string
	Status              string
	StatusMessage       string
	validator.Validator `json:"-" db:"-" form:"-"`
}

Jump to

Keyboard shortcuts

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