doc: add documentation of functions and licence
This commit is contained in:
parent
fe5d84d200
commit
f451d69d70
5 changed files with 38 additions and 5 deletions
|
|
@ -158,6 +158,7 @@ func (f *Field) WithOptions(options ...*Option) *Field {
|
|||
return f
|
||||
}
|
||||
|
||||
// Remove an option if exists
|
||||
func (f *Field) RemoveOption(name string) *Field {
|
||||
var options []*Option
|
||||
|
||||
|
|
@ -377,6 +378,7 @@ func (f *Field) Bind(data map[string]any, key *string, parentIsSlice bool) error
|
|||
return nil
|
||||
}
|
||||
|
||||
// Generates a tree of errors
|
||||
func (f *Field) ErrorsTree(tree map[string]any, key *string) {
|
||||
var index string
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
package form
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// @license GNU AGPL version 3 or any later version
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -20,6 +15,11 @@ import (
|
|||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// Generates a sub form
|
||||
func NewFieldCollection(name string) *Field {
|
||||
f := NewField(name, "collection").
|
||||
|
|
|
|||
|
|
@ -293,6 +293,7 @@ func (f *Form) IsSubmitted() bool {
|
|||
return f.RequestData != nil
|
||||
}
|
||||
|
||||
// Generates a tree of errors
|
||||
func (f *Form) ErrorsTree() map[string]any {
|
||||
errors := make(map[string]any)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,20 @@
|
|||
package util
|
||||
|
||||
// @license GNU AGPL version 3 or any later version
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,20 @@
|
|||
package util
|
||||
|
||||
// @license GNU AGPL version 3 or any later version
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue