mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 02:12:25 -05:00
[chore] rename New___(string) int signature functions to Parse___(string) int (#3580)
* rename New___(string) int {} signature functions to Parse___(string) int {}
* remove test output
This commit is contained in:
parent
65917f5bb9
commit
312cb8b9c7
7 changed files with 26 additions and 26 deletions
|
|
@ -19,6 +19,7 @@ package gtsmodel
|
|||
|
||||
import (
|
||||
"path"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
|
@ -46,8 +47,8 @@ func (c AdminActionCategory) String() string {
|
|||
}
|
||||
}
|
||||
|
||||
func NewAdminActionCategory(in string) AdminActionCategory {
|
||||
switch in {
|
||||
func ParseAdminActionCategory(in string) AdminActionCategory {
|
||||
switch strings.ToLower(in) {
|
||||
case "account":
|
||||
return AdminActionCategoryAccount
|
||||
case "domain":
|
||||
|
|
@ -96,8 +97,8 @@ func (t AdminActionType) String() string {
|
|||
}
|
||||
}
|
||||
|
||||
func NewAdminActionType(in string) AdminActionType {
|
||||
switch in {
|
||||
func ParseAdminActionType(in string) AdminActionType {
|
||||
switch strings.ToLower(in) {
|
||||
case "disable":
|
||||
return AdminActionDisable
|
||||
case "reenable":
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@
|
|||
|
||||
package gtsmodel
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// DomainPermission models a domain permission
|
||||
// entry -- block / allow / draft / exclude.
|
||||
|
|
@ -62,8 +65,8 @@ func (p DomainPermissionType) String() string {
|
|||
}
|
||||
}
|
||||
|
||||
func NewDomainPermissionType(in string) DomainPermissionType {
|
||||
switch in {
|
||||
func ParseDomainPermissionType(in string) DomainPermissionType {
|
||||
switch strings.ToLower(in) {
|
||||
case "block":
|
||||
return DomainPermissionBlock
|
||||
case "allow":
|
||||
|
|
|
|||
|
|
@ -87,8 +87,8 @@ func (t NotificationType) String() string {
|
|||
}
|
||||
}
|
||||
|
||||
// NewNotificationType returns a notification type from the given value.
|
||||
func NewNotificationType(in string) NotificationType {
|
||||
// ParseNotificationType returns a notification type from the given value.
|
||||
func ParseNotificationType(in string) NotificationType {
|
||||
switch strings.ToLower(in) {
|
||||
case "follow":
|
||||
return NotificationFollow
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue