mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-28 11:40:04 +00:00
Fix linting problems
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
.idea
|
git.idea
|
||||||
.env
|
.env
|
||||||
.DS_Store
|
.DS_Store
|
||||||
._*
|
._*
|
||||||
@@ -18,3 +18,4 @@ test/cypress/fixtures/example.json
|
|||||||
.vscode
|
.vscode
|
||||||
docker-build
|
docker-build
|
||||||
data
|
data
|
||||||
|
dist
|
||||||
|
@@ -10,7 +10,7 @@ import (
|
|||||||
"npm/internal/logger"
|
"npm/internal/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetAuth ...
|
// SetAuth sets a auth method
|
||||||
// Route: POST /users/:userID/auth
|
// Route: POST /users/:userID/auth
|
||||||
func SetAuth() func(http.ResponseWriter, *http.Request) {
|
func SetAuth() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@@ -72,7 +72,7 @@ func CreateCertificateAuthority() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateCertificateAuthority ...
|
// UpdateCertificateAuthority updates a ca
|
||||||
// Route: PUT /certificate-authorities/{caID}
|
// Route: PUT /certificate-authorities/{caID}
|
||||||
func UpdateCertificateAuthority() func(http.ResponseWriter, *http.Request) {
|
func UpdateCertificateAuthority() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -105,7 +105,7 @@ func UpdateCertificateAuthority() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteCertificateAuthority ...
|
// DeleteCertificateAuthority deletes a ca
|
||||||
// Route: DELETE /certificate-authorities/{caID}
|
// Route: DELETE /certificate-authorities/{caID}
|
||||||
func DeleteCertificateAuthority() func(http.ResponseWriter, *http.Request) {
|
func DeleteCertificateAuthority() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@@ -77,7 +77,7 @@ func CreateCertificate() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateCertificate ...
|
// UpdateCertificate updates a cert
|
||||||
// Route: PUT /certificates/{certificateID}
|
// Route: PUT /certificates/{certificateID}
|
||||||
func UpdateCertificate() func(http.ResponseWriter, *http.Request) {
|
func UpdateCertificate() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -124,7 +124,7 @@ func UpdateCertificate() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteCertificate ...
|
// DeleteCertificate deletes a cert
|
||||||
// Route: DELETE /certificates/{certificateID}
|
// Route: DELETE /certificates/{certificateID}
|
||||||
func DeleteCertificate() func(http.ResponseWriter, *http.Request) {
|
func DeleteCertificate() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@@ -76,7 +76,7 @@ func CreateDNSProvider() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateDNSProvider ...
|
// UpdateDNSProvider updates a provider
|
||||||
// Route: PUT /dns-providers/{providerID}
|
// Route: PUT /dns-providers/{providerID}
|
||||||
func UpdateDNSProvider() func(http.ResponseWriter, *http.Request) {
|
func UpdateDNSProvider() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -108,7 +108,7 @@ func UpdateDNSProvider() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteDNSProvider ...
|
// DeleteDNSProvider removes a provider
|
||||||
// Route: DELETE /dns-providers/{providerID}
|
// Route: DELETE /dns-providers/{providerID}
|
||||||
func DeleteDNSProvider() func(http.ResponseWriter, *http.Request) {
|
func DeleteDNSProvider() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@@ -82,7 +82,7 @@ func CreateHost() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateHost ...
|
// UpdateHost updates a host
|
||||||
// Route: PUT /hosts/{hostID}
|
// Route: PUT /hosts/{hostID}
|
||||||
func UpdateHost() func(http.ResponseWriter, *http.Request) {
|
func UpdateHost() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -114,7 +114,7 @@ func UpdateHost() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteHost ...
|
// DeleteHost removes a host
|
||||||
// Route: DELETE /hosts/{hostID}
|
// Route: DELETE /hosts/{hostID}
|
||||||
func DeleteHost() func(http.ResponseWriter, *http.Request) {
|
func DeleteHost() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@@ -69,7 +69,7 @@ func CreateSetting() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateSetting ...
|
// UpdateSetting updates a setting
|
||||||
// Route: PUT /settings/{name}
|
// Route: PUT /settings/{name}
|
||||||
func UpdateSetting() func(http.ResponseWriter, *http.Request) {
|
func UpdateSetting() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@@ -76,7 +76,7 @@ func CreateStream() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateStream ...
|
// UpdateStream updates a stream
|
||||||
// Route: PUT /hosts/streams/{hostID}
|
// Route: PUT /hosts/streams/{hostID}
|
||||||
func UpdateStream() func(http.ResponseWriter, *http.Request) {
|
func UpdateStream() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -108,7 +108,7 @@ func UpdateStream() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteStream ...
|
// DeleteStream removes a stream
|
||||||
// Route: DELETE /hosts/streams/{hostID}
|
// Route: DELETE /hosts/streams/{hostID}
|
||||||
func DeleteStream() func(http.ResponseWriter, *http.Request) {
|
func DeleteStream() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetUsers ...
|
// GetUsers returns all users
|
||||||
// Route: GET /users
|
// Route: GET /users
|
||||||
func GetUsers() func(http.ResponseWriter, *http.Request) {
|
func GetUsers() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -35,7 +35,7 @@ func GetUsers() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUser ...
|
// GetUser returns a specific user
|
||||||
// Route: GET /users/{userID}
|
// Route: GET /users/{userID}
|
||||||
func GetUser() func(http.ResponseWriter, *http.Request) {
|
func GetUser() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -55,7 +55,7 @@ func GetUser() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateUser ...
|
// UpdateUser updates a user
|
||||||
// Route: PUT /users/{userID}
|
// Route: PUT /users/{userID}
|
||||||
func UpdateUser() func(http.ResponseWriter, *http.Request) {
|
func UpdateUser() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -96,7 +96,7 @@ func UpdateUser() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteUser ...
|
// DeleteUser removes a user
|
||||||
// Route: DELETE /users/{userID}
|
// Route: DELETE /users/{userID}
|
||||||
func DeleteUser() func(http.ResponseWriter, *http.Request) {
|
func DeleteUser() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -122,7 +122,7 @@ func DeleteUser() func(http.ResponseWriter, *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateUser ...
|
// CreateUser creates a user
|
||||||
// Route: POST /users
|
// Route: POST /users
|
||||||
func CreateUser() func(http.ResponseWriter, *http.Request) {
|
func CreateUser() func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@@ -9,9 +9,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// ErrInvalidJSON ...
|
// ErrInvalidJSON is an error for invalid json
|
||||||
ErrInvalidJSON = errors.New("JSON is invalid")
|
ErrInvalidJSON = errors.New("JSON is invalid")
|
||||||
// ErrInvalidPayload ...
|
// ErrInvalidPayload is an error for invalid incoming data
|
||||||
ErrInvalidPayload = errors.New("Payload is invalid")
|
ErrInvalidPayload = errors.New("Payload is invalid")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -14,7 +14,7 @@ import (
|
|||||||
"github.com/go-chi/jwtauth"
|
"github.com/go-chi/jwtauth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DecodeAuth ...
|
// DecodeAuth decodes an auth header
|
||||||
func DecodeAuth() func(http.Handler) http.Handler {
|
func DecodeAuth() func(http.Handler) http.Handler {
|
||||||
privateKey, privateKeyParseErr := njwt.GetPrivateKey()
|
privateKey, privateKeyParseErr := njwt.GetPrivateKey()
|
||||||
if privateKeyParseErr != nil && privateKey == nil {
|
if privateKeyParseErr != nil && privateKey == nil {
|
||||||
|
@@ -46,7 +46,7 @@ var headersAllowedByCORS = []string{
|
|||||||
"X-Jumbo-Customer-Id",
|
"X-Jumbo-Customer-Id",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cors ...
|
// Cors handles cors headers
|
||||||
func Cors(routes chi.Router) func(http.Handler) http.Handler {
|
func Cors(routes chi.Router) func(http.Handler) http.Handler {
|
||||||
return func(next http.Handler) http.Handler {
|
return func(next http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -66,7 +66,7 @@ func Cors(routes chi.Router) func(http.Handler) http.Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Options ...
|
// Options handles options requests
|
||||||
func Options(routes chi.Router) func(http.Handler) http.Handler {
|
func Options(routes chi.Router) func(http.Handler) http.Handler {
|
||||||
return func(next http.Handler) http.Handler {
|
return func(next http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/qri-io/jsonschema"
|
"github.com/qri-io/jsonschema"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CheckRequestSchema ...
|
// CheckRequestSchema checks the payload against schema
|
||||||
func CheckRequestSchema(ctx context.Context, schemaData string, payload []byte) ([]jsonschema.KeyError, error) {
|
func CheckRequestSchema(ctx context.Context, schemaData string, payload []byte) ([]jsonschema.KeyError, error) {
|
||||||
// Create root schema
|
// Create root schema
|
||||||
rs := &jsonschema.Schema{}
|
rs := &jsonschema.Schema{}
|
||||||
|
@@ -14,10 +14,10 @@ var IsSetup bool
|
|||||||
// ErrorReporting defines whether we will send errors to Sentry
|
// ErrorReporting defines whether we will send errors to Sentry
|
||||||
var ErrorReporting bool
|
var ErrorReporting bool
|
||||||
|
|
||||||
// PublicKey ...
|
// PublicKey is the public key
|
||||||
var PublicKey string
|
var PublicKey string
|
||||||
|
|
||||||
// PrivateKey ...
|
// PrivateKey is the private key
|
||||||
var PrivateKey string
|
var PrivateKey string
|
||||||
|
|
||||||
var logLevel logger.Level
|
var logLevel logger.Level
|
||||||
@@ -27,7 +27,7 @@ type log struct {
|
|||||||
Format string `json:"format" envconfig:"optional,default=nice"`
|
Format string `json:"format" envconfig:"optional,default=nice"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configuration ...
|
// Configuration is the main configuration object
|
||||||
var Configuration struct {
|
var Configuration struct {
|
||||||
DataFolder string `json:"data_folder" envconfig:"optional,default=/data"`
|
DataFolder string `json:"data_folder" envconfig:"optional,default=/data"`
|
||||||
Log log `json:"log"`
|
Log log `json:"log"`
|
||||||
|
@@ -18,7 +18,7 @@ func getFilterMapFunctions() map[string]entity.FilterMapFunction {
|
|||||||
return filterMapFunctions
|
return filterMapFunctions
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFilterSchema ...
|
// GetFilterSchema returns filter schema
|
||||||
func GetFilterSchema() string {
|
func GetFilterSchema() string {
|
||||||
var m Model
|
var m Model
|
||||||
return entity.GetFilterSchema(m)
|
return entity.GetFilterSchema(m)
|
||||||
|
@@ -13,14 +13,15 @@ import (
|
|||||||
const (
|
const (
|
||||||
tableName = "certificate"
|
tableName = "certificate"
|
||||||
|
|
||||||
// TypeCustom ...
|
// TypeCustom custom cert type
|
||||||
TypeCustom = "custom"
|
TypeCustom = "custom"
|
||||||
// TypeHTTP ...
|
// TypeHTTP http cert type
|
||||||
TypeHTTP = "http"
|
TypeHTTP = "http"
|
||||||
// TypeDNS ...
|
// TypeDNS dns cert type
|
||||||
TypeDNS = "dns"
|
TypeDNS = "dns"
|
||||||
// TypeMkcert ...
|
// TypeMkcert mkcert cert type
|
||||||
TypeMkcert = "mkcert"
|
TypeMkcert = "mkcert"
|
||||||
|
|
||||||
// StatusReady is ready for certificate to be requested
|
// StatusReady is ready for certificate to be requested
|
||||||
StatusReady = "ready"
|
StatusReady = "ready"
|
||||||
// StatusRequesting is process of being requested
|
// StatusRequesting is process of being requested
|
||||||
@@ -151,7 +152,7 @@ func (m *Model) Expand() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request ...
|
// Request makes a certificate request
|
||||||
func (m *Model) Request() error {
|
func (m *Model) Request() error {
|
||||||
m.Expand()
|
m.Expand()
|
||||||
m.Status = StatusRequesting
|
m.Status = StatusRequesting
|
||||||
|
@@ -18,7 +18,7 @@ func getFilterMapFunctions() map[string]entity.FilterMapFunction {
|
|||||||
return filterMapFunctions
|
return filterMapFunctions
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFilterSchema ...
|
// GetFilterSchema returns filter schema
|
||||||
func GetFilterSchema() string {
|
func GetFilterSchema() string {
|
||||||
var m Model
|
var m Model
|
||||||
return entity.GetFilterSchema(m)
|
return entity.GetFilterSchema(m)
|
||||||
|
@@ -18,7 +18,7 @@ func getFilterMapFunctions() map[string]entity.FilterMapFunction {
|
|||||||
return filterMapFunctions
|
return filterMapFunctions
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFilterSchema ...
|
// GetFilterSchema returns filter schema
|
||||||
func GetFilterSchema() string {
|
func GetFilterSchema() string {
|
||||||
var m Model
|
var m Model
|
||||||
return entity.GetFilterSchema(m)
|
return entity.GetFilterSchema(m)
|
||||||
|
@@ -11,10 +11,10 @@ import (
|
|||||||
// FilterMapFunction is a filter map function
|
// FilterMapFunction is a filter map function
|
||||||
type FilterMapFunction func(value []string) []string
|
type FilterMapFunction func(value []string) []string
|
||||||
|
|
||||||
// FilterTagName ...
|
// FilterTagName tag name user for filter pickups
|
||||||
const FilterTagName = "filter"
|
const FilterTagName = "filter"
|
||||||
|
|
||||||
// DBTagName ...
|
// DBTagName tag name user for field name pickups
|
||||||
const DBTagName = "db"
|
const DBTagName = "db"
|
||||||
|
|
||||||
// GenerateSQLFromFilters will return a Query and params for use as WHERE clause in SQL queries
|
// GenerateSQLFromFilters will return a Query and params for use as WHERE clause in SQL queries
|
||||||
@@ -96,7 +96,7 @@ func getSQLAssignmentFromModifier(filter model.Filter, params *[]interface{}) st
|
|||||||
return clause
|
return clause
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFilterMap ...
|
// GetFilterMap returns the filter map
|
||||||
func GetFilterMap(m interface{}) map[string]string {
|
func GetFilterMap(m interface{}) map[string]string {
|
||||||
var filterMap = make(map[string]string)
|
var filterMap = make(map[string]string)
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ func GetFilterMap(m interface{}) map[string]string {
|
|||||||
return filterMap
|
return filterMap
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDBColumns ...
|
// GetDBColumns returns the db columns
|
||||||
func GetDBColumns(m interface{}) []string {
|
func GetDBColumns(m interface{}) []string {
|
||||||
var columns []string
|
var columns []string
|
||||||
t := reflect.TypeOf(m)
|
t := reflect.TypeOf(m)
|
||||||
|
@@ -18,7 +18,7 @@ func getFilterMapFunctions() map[string]entity.FilterMapFunction {
|
|||||||
return filterMapFunctions
|
return filterMapFunctions
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFilterSchema ...
|
// GetFilterSchema returns filter schema
|
||||||
func GetFilterSchema() string {
|
func GetFilterSchema() string {
|
||||||
var m Model
|
var m Model
|
||||||
return entity.GetFilterSchema(m)
|
return entity.GetFilterSchema(m)
|
||||||
|
@@ -11,11 +11,11 @@ import (
|
|||||||
const (
|
const (
|
||||||
tableName = "host"
|
tableName = "host"
|
||||||
|
|
||||||
// ProxyHostType ...
|
// ProxyHostType is self explanatory
|
||||||
ProxyHostType = "proxy"
|
ProxyHostType = "proxy"
|
||||||
// RedirectionHostType ...
|
// RedirectionHostType is self explanatory
|
||||||
RedirectionHostType = "redirection"
|
RedirectionHostType = "redirection"
|
||||||
// DeadHostType ...
|
// DeadHostType is self explanatory
|
||||||
DeadHostType = "dead"
|
DeadHostType = "dead"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ func getFilterMapFunctions() map[string]entity.FilterMapFunction {
|
|||||||
return filterMapFunctions
|
return filterMapFunctions
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFilterSchema ...
|
// GetFilterSchema returns filter schema
|
||||||
func GetFilterSchema() string {
|
func GetFilterSchema() string {
|
||||||
var m Model
|
var m Model
|
||||||
return entity.GetFilterSchema(m)
|
return entity.GetFilterSchema(m)
|
||||||
|
@@ -18,7 +18,7 @@ func getFilterMapFunctions() map[string]entity.FilterMapFunction {
|
|||||||
return filterMapFunctions
|
return filterMapFunctions
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFilterSchema ...
|
// GetFilterSchema returns filter schema
|
||||||
func GetFilterSchema() string {
|
func GetFilterSchema() string {
|
||||||
var m Model
|
var m Model
|
||||||
return entity.GetFilterSchema(m)
|
return entity.GetFilterSchema(m)
|
||||||
|
@@ -18,7 +18,7 @@ func getFilterMapFunctions() map[string]entity.FilterMapFunction {
|
|||||||
return filterMapFunctions
|
return filterMapFunctions
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFilterSchema ...
|
// GetFilterSchema returns filter schema
|
||||||
func GetFilterSchema() string {
|
func GetFilterSchema() string {
|
||||||
var m Model
|
var m Model
|
||||||
return entity.GetFilterSchema(m)
|
return entity.GetFilterSchema(m)
|
||||||
|
@@ -15,7 +15,7 @@ type PageInfo struct {
|
|||||||
Expand []string `json:"expand"`
|
Expand []string `json:"expand"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort ...
|
// Sort holds the sorting data
|
||||||
type Sort struct {
|
type Sort struct {
|
||||||
Field string `json:"field"`
|
Field string `json:"field"`
|
||||||
Direction string `json:"direction"`
|
Direction string `json:"direction"`
|
||||||
|
@@ -11,7 +11,7 @@ type AppState struct {
|
|||||||
termSig chan bool
|
termSig chan bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewState ...
|
// NewState creates a new app state
|
||||||
func NewState() *AppState {
|
func NewState() *AppState {
|
||||||
state := &AppState{
|
state := &AppState{
|
||||||
// buffered channel
|
// buffered channel
|
||||||
@@ -20,12 +20,12 @@ func NewState() *AppState {
|
|||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetWaitGroup ...
|
// GetWaitGroup returns the state's wg
|
||||||
func (state *AppState) GetWaitGroup() *sync.WaitGroup {
|
func (state *AppState) GetWaitGroup() *sync.WaitGroup {
|
||||||
return &state.waitGroup
|
return &state.waitGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTermSig ...
|
// GetTermSig returns the state's term signal
|
||||||
func (state *AppState) GetTermSig() chan bool {
|
func (state *AppState) GetTermSig() chan bool {
|
||||||
return state.termSig
|
return state.termSig
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user