Documentation
¶
Index ¶
- Variables
- func DataTypeNeedDecimalValue(dataType string) bool
- func DataTypeNeedLength(dataType string) bool
- type DSField
- type Param
- func (p *Param) AssignDSFieldNames()
- func (p *Param) DsHasField(fieldId string) bool
- func (p *Param) DsJson(dim uint) []map[string]any
- func (p *Param) FilterOutInvalidParams()
- func (p *Param) GetDataType() string
- func (p *Param) GetSpecialText() string
- func (p *Param) HasValidValue(val string) bool
- func (p *Param) Init()
- func (p *Param) IsValid() error
- func (s *Param) LogImage() string
- func (p *Param) NoNDsJson(dim uint) []string
- func (p *Param) ToString() string
- func (p *Param) ToXml(nameToUse string, inparams map[string]xmlutils.ValueDatatype, usage string, ...) (string, error)
- func (p *Param) ValidateFields() bool
- type ProgramParams
- type RpgEndPoint
- func (s *RpgEndPoint) AddAllowedServer(serverID string)
- func (s *RpgEndPoint) AssignAliasForPathPlacement()
- func (p *RpgEndPoint) AssignParamNames()
- func (p *RpgEndPoint) AssignParamObjects(rpgParamModel *RpgParamModel)
- func (s *RpgEndPoint) AvailableParamterPostions() []string
- func (s *RpgEndPoint) BuildMockUrl()
- func (s *RpgEndPoint) BuildMockUrlGET()
- func (s *RpgEndPoint) BuildMockUrlPost()
- func (s *RpgEndPoint) DeleteAllowedServer(serverID string)
- func (s *RpgEndPoint) EPDetailUrl() template.HTML
- func (s *RpgEndPoint) EPHander() string
- func (s *RpgEndPoint) EPID() string
- func (s *RpgEndPoint) EPMaxLogEntries() int
- func (s *RpgEndPoint) EPMethod() string
- func (s *RpgEndPoint) EPName() string
- func (s *RpgEndPoint) EPNameSpace() string
- func (s *RpgEndPoint) EPServerId() string
- func (s *RpgEndPoint) EPType() string
- func (p *RpgEndPoint) FilterOutInvalidParams()
- func (s *RpgEndPoint) GetNamespace() string
- func (p *RpgEndPoint) Init()
- func (s *RpgEndPoint) InputParamJson() string
- func (s *RpgEndPoint) IsAllowedForServer(serverID string) bool
- func (p *RpgEndPoint) IsUsingField(rpgParamModel *RpgParamModel, fieldID string) bool
- func (s *RpgEndPoint) OutputStructureJson() string
- func (p *RpgEndPoint) ParamStrings(inparams map[string]xmlutils.ValueDatatype) ([]string, error)
- func (s *RpgEndPoint) Refresh()
- func (s *RpgEndPoint) SetNameSpace()
- func (s *RpgEndPoint) Slug() string
- func (p *RpgEndPoint) ToXML(inparams map[string]xmlutils.ValueDatatype) (string, error)
- func (p *RpgEndPoint) ValidateParams() bool
- type RpgEndpointModel
- func (m *RpgEndpointModel) Delete(id string) error
- func (m *RpgEndpointModel) DeleteByName(name string, method string) error
- func (m *RpgEndpointModel) Duplicate(u *RpgEndPoint) bool
- func (m *RpgEndpointModel) DuplicateByName(name string, method string, namespace string) bool
- func (m *RpgEndpointModel) Exists(id string) bool
- func (m *RpgEndpointModel) Get(id string) (*RpgEndPoint, error)
- func (m *RpgEndpointModel) List() []*RpgEndPoint
- func (m *RpgEndpointModel) LoadParameter(p *RpgEndPoint)
- func (m *RpgEndpointModel) Save(u *RpgEndPoint) (string, error)
- type RpgParamModel
- func (m *RpgParamModel) Delete(id string) error
- func (m *RpgParamModel) DuplicateName(rpgparamToCheck *Param) bool
- func (m *RpgParamModel) Exists(id string) bool
- func (m *RpgParamModel) Get(id string) (*Param, error)
- func (m *RpgParamModel) List() []*Param
- func (m *RpgParamModel) Save(u *Param) (string, error)
- func (m *RpgParamModel) Update(u *Param, clearCache bool) error
Constants ¶
This section is empty.
Variables ¶
var DataTypeMap map[string]string = map[string]string{
"INTEGER 3i0": "3i0",
"INTEGER 5i0": "5i0",
"INTEGER 10i0": "10i0",
"INTEGER 20i0": "20i0",
"UNSIGNED INTEGER 3u0": "3u0",
"UNSIGNED INTEGER 5u0": "5u0",
"UNSIGNED INTEGER 10u0": "10u0",
"UNSIGNED INTEGER 20u0": "20u0",
"PACKED": "%dp%d",
"ZONED": "%ds%d",
"FLOAT 4f": "4f2",
"FLOAT 8f": "8f2",
"VARYING ALPHANUMERIC/CHAR": "%da",
"ALPHANUMERIC/CHAR": "%da",
"TIME": "8A",
"TIMESTAMP": "26A",
"DATE": "10A",
}
------------------------------------------------------------
------------------------------------------------------------
var DataTypeSpecialText map[string]string = map[string]string{
"VARYING ALPHANUMERIC/CHAR": "varying='on'",
}
------------------------------------------------------------
------------------------------------------------------------
var DataTypeValidator map[string]func(string, int, int) bool = map[string]func(string, int, int) bool{
"INTEGER 3i0": intValidator,
"INTEGER 5i0": intValidator,
"INTEGER 10i0": intValidator,
"INTEGER 20i0": intValidator,
"UNSIGNED INTEGER 3u0": uintValidator,
"UNSIGNED INTEGER 5u0": uintValidator,
"UNSIGNED INTEGER 10u0": uintValidator,
"UNSIGNED INTEGER 20u0": uintValidator,
"PACKED": floatValidator,
"ZONED": floatValidator,
"FLOAT 4f": floatValidator,
"FLOAT 8f": floatValidator,
"VARYING ALPHANUMERIC/CHAR": charValidator,
"ALPHANUMERIC/CHAR": charValidator,
"TIME": timeValidator,
"TIMESTAMP": dateValidator,
"DATE": timestampValidator,
}
------------------------------------------------------------
------------------------------------------------------------
Functions ¶
func DataTypeNeedDecimalValue ¶
------------------------------------------------------------
------------------------------------------------------------
func DataTypeNeedLength ¶
------------------------------------------------------------
------------------------------------------------------------
Types ¶
type DSField ¶
type DSField struct { NameToUse string ParamID string Dim uint Param *Param `json:"-" db:"-" form:"-"` validator.Validator `db:"-" form:"-"` // this contains the fielderror }
-----------------------------------------------------
-----------------------------------------------------
type Param ¶
type Param struct { ID string `json:"id" db:"id" form:"id"` Name string `json:"name" db:"name" form:"name"` DataType string `json:"datatype" db:"datatype" form:"datatype"` Length uint `json:"length" db:"length" form:"length"` DecimalPostions uint `json:"decimalpostions" db:"decimalpostions" form:"decimalpostions"` IsDs bool `json:"isds" db:"isds" form:"isds"` DsFields []*DSField validator.Validator `json:"-" db:"-" form:"-"` // this contains the fielderror }
func (*Param) AssignDSFieldNames ¶
func (p *Param) AssignDSFieldNames()
------------------------------------------------------------
------------------------------------------------------------
func (*Param) DsHasField ¶
------------------------------------------------------------
------------------------------------------------------------
func (*Param) DsJson ¶
------------------------------------------------------------
------------------------------------------------------------
func (*Param) FilterOutInvalidParams ¶
func (p *Param) FilterOutInvalidParams()
------------------------------------------------------------
------------------------------------------------------------
func (*Param) GetDataType ¶
-----------------------------------------------------
-----------------------------------------------------
func (*Param) GetSpecialText ¶
-----------------------------------------------------
-----------------------------------------------------
func (*Param) HasValidValue ¶
-----------------------------------------------------
-----------------------------------------------------
func (*Param) Init ¶
func (p *Param) Init()
------------------------------------------------------------
------------------------------------------------------------
func (*Param) IsValid ¶
-----------------------------------------------------
-----------------------------------------------------
func (*Param) LogImage ¶
------------------------------------------------------------
------------------------------------------------------------
func (*Param) NoNDsJson ¶
------------------------------------------------------------
------------------------------------------------------------
func (*Param) ToString ¶
------------------------------------------------------------
------------------------------------------------------------
func (*Param) ToXml ¶
func (p *Param) ToXml(nameToUse string, inparams map[string]xmlutils.ValueDatatype, usage string, dim uint) (string, error)
-----------------------------------------------------
-----------------------------------------------------
func (*Param) ValidateFields ¶
------------------------------------------------------------
------------------------------------------------------------
type ProgramParams ¶
type ProgramParams struct { Seq uint Dim uint InOutType string FieldID string Placement string NameToUse string Param *Param `json:"-" db:"-" form:"-"` validator.Validator `json:"-" db:"-" form:"-"` // this contains the fielderror }
-----------------------------------------------------
-----------------------------------------------------
func (*ProgramParams) GetNameToUse ¶
func (p *ProgramParams) GetNameToUse() string
-----------------------------------------------------
-----------------------------------------------------
type RpgEndPoint ¶
type RpgEndPoint 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"` DefaultServerId string `json:"serverid" db:"serverid" form:"serverid"` AllowedOnServers []string `json:"allowedonservers" db:"allowedonservers" form:"allowedonservers"` MockUrl string `json:"mockurl" db:"mockurl" form:"-"` MockUrlWithoutAuth string `json:"mockurlnoa" db:"mockurlnoa" form:"-"` AllowWithoutAuth bool `json:"awoauth" db:"awoauth" form:"awoauth"` HtmlTemplate string `json:"htmltemplate" db:"htmltemplate" form:"htmltemplate"` Namespace string `json:"namespace" db:"namespace" form:"namespace"` InputPayload string `json:"inputpayload" db:"inputpayload" form:"inputpayload"` ResponseFormat string `json:"responseformat" db:"responseformat" form:"-"` Promotionsql string `json:"promotionsql" db:"promotionsql" form:"-"` MaxlogEntries int `json:"maxlogentries" db:"maxlogentries" form:"maxlogentries"` Name string `json:"name" db:"name" form:"name"` Lib string `json:"lib" db:"lib" form:"lib"` Parameters []*ProgramParams validator.Validator `json:"-" db:"-" form:"-"` // this contains the fielderror }
func (*RpgEndPoint) AddAllowedServer ¶
func (s *RpgEndPoint) AddAllowedServer(serverID string)
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) AssignAliasForPathPlacement ¶
func (s *RpgEndPoint) AssignAliasForPathPlacement()
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) AssignParamNames ¶
func (p *RpgEndPoint) AssignParamNames()
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) AssignParamObjects ¶
func (p *RpgEndPoint) AssignParamObjects(rpgParamModel *RpgParamModel)
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) AvailableParamterPostions ¶
func (s *RpgEndPoint) AvailableParamterPostions() []string
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) BuildMockUrl ¶
func (s *RpgEndPoint) BuildMockUrl()
------------------------------------------------------------ BuildMockUrl(s) ------------------------------------------------------------
func (*RpgEndPoint) BuildMockUrlGET ¶
func (s *RpgEndPoint) BuildMockUrlGET()
------------------------------------------------------------ BuildMockUrl(s) ------------------------------------------------------------
func (*RpgEndPoint) BuildMockUrlPost ¶
func (s *RpgEndPoint) BuildMockUrlPost()
------------------------------------------------------------ BuildMockUrl(s) ------------------------------------------------------------
func (*RpgEndPoint) DeleteAllowedServer ¶
func (s *RpgEndPoint) DeleteAllowedServer(serverID string)
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) EPDetailUrl ¶
func (s *RpgEndPoint) EPDetailUrl() template.HTML
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) EPHander ¶
func (s *RpgEndPoint) EPHander() string
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) EPID ¶
func (s *RpgEndPoint) EPID() string
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) EPMaxLogEntries ¶
func (s *RpgEndPoint) EPMaxLogEntries() int
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) EPMethod ¶
func (s *RpgEndPoint) EPMethod() string
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) EPName ¶
func (s *RpgEndPoint) EPName() string
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) EPNameSpace ¶
func (s *RpgEndPoint) EPNameSpace() string
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) EPServerId ¶
func (s *RpgEndPoint) EPServerId() string
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) EPType ¶
func (s *RpgEndPoint) EPType() string
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) FilterOutInvalidParams ¶
func (p *RpgEndPoint) FilterOutInvalidParams()
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) GetNamespace ¶
func (s *RpgEndPoint) GetNamespace() string
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) Init ¶
func (p *RpgEndPoint) Init()
-----------------------------------------------------
-----------------------------------------------------
func (*RpgEndPoint) InputParamJson ¶
func (s *RpgEndPoint) InputParamJson() string
------------------------------------------------------------ BuildMockUrl(s) ------------------------------------------------------------
func (*RpgEndPoint) IsAllowedForServer ¶
func (s *RpgEndPoint) IsAllowedForServer(serverID string) bool
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) IsUsingField ¶
func (p *RpgEndPoint) IsUsingField(rpgParamModel *RpgParamModel, fieldID string) bool
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) OutputStructureJson ¶
func (s *RpgEndPoint) OutputStructureJson() string
------------------------------------------------------------ BuildMockUrl(s) ------------------------------------------------------------
func (*RpgEndPoint) ParamStrings ¶
func (p *RpgEndPoint) ParamStrings(inparams map[string]xmlutils.ValueDatatype) ([]string, error)
-----------------------------------------------------
-----------------------------------------------------
func (*RpgEndPoint) Refresh ¶
func (s *RpgEndPoint) Refresh()
-----------------------------------------------------
-----------------------------------------------------
func (*RpgEndPoint) SetNameSpace ¶
func (s *RpgEndPoint) SetNameSpace()
------------------------------------------------------------ set name space value ------------------------------------------------------------
func (*RpgEndPoint) Slug ¶
func (s *RpgEndPoint) Slug() string
------------------------------------------------------------
------------------------------------------------------------
func (*RpgEndPoint) ToXML ¶
func (p *RpgEndPoint) ToXML(inparams map[string]xmlutils.ValueDatatype) (string, error)
-----------------------------------------------------
-----------------------------------------------------
func (*RpgEndPoint) ValidateParams ¶
func (p *RpgEndPoint) ValidateParams() bool
------------------------------------------------------------
------------------------------------------------------------
type RpgEndpointModel ¶
func (*RpgEndpointModel) Delete ¶
func (m *RpgEndpointModel) Delete(id string) error
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Insert method to add a new record to the "users" table.
func (*RpgEndpointModel) DeleteByName ¶
func (m *RpgEndpointModel) DeleteByName(name string, method string) error
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Insert method to add a new record to the "users" table.
func (*RpgEndpointModel) Duplicate ¶
func (m *RpgEndpointModel) Duplicate(u *RpgEndPoint) bool
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Exists method to check if a user exists with a specific ID.
func (*RpgEndpointModel) DuplicateByName ¶
func (m *RpgEndpointModel) DuplicateByName(name string, method string, namespace string) bool
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Exists method to check if a user exists with a specific ID.
func (*RpgEndpointModel) Exists ¶
func (m *RpgEndpointModel) Exists(id string) bool
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Exists method to check if a user exists with a specific ID.
func (*RpgEndpointModel) Get ¶
func (m *RpgEndpointModel) Get(id string) (*RpgEndPoint, error)
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Exists method to check if a user exists with a specific ID.
func (*RpgEndpointModel) List ¶
func (m *RpgEndpointModel) List() []*RpgEndPoint
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Exists method to check if a user exists with a specific ID.
func (*RpgEndpointModel) LoadParameter ¶
func (m *RpgEndpointModel) LoadParameter(p *RpgEndPoint)
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Exists method to check if a user exists with a specific ID.
func (*RpgEndpointModel) Save ¶
func (m *RpgEndpointModel) Save(u *RpgEndPoint) (string, error)
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Insert method to add a new record to the "users" table.
type RpgParamModel ¶
-----------------------------------------------------------------
----------------------------------------------------------------- Define a new UserModel type which wraps a database connection pool.
func (*RpgParamModel) Delete ¶
func (m *RpgParamModel) Delete(id string) error
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Insert method to add a new record to the "users" table.
func (*RpgParamModel) DuplicateName ¶
func (m *RpgParamModel) DuplicateName(rpgparamToCheck *Param) bool
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Exists method to check if a user exists with a specific ID.
func (*RpgParamModel) Exists ¶
func (m *RpgParamModel) Exists(id string) bool
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Exists method to check if a user exists with a specific ID.
func (*RpgParamModel) Get ¶
func (m *RpgParamModel) Get(id string) (*Param, error)
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Exists method to check if a user exists with a specific ID.
func (*RpgParamModel) List ¶
func (m *RpgParamModel) List() []*Param
-----------------------------------------------------------------
----------------------------------------------------------------- We'll use the Exists method to check if a user exists with a specific ID.