types

package
v0.0.0-...-3904f54 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonToStringMap

func JsonToStringMap(data datatypes.JSONMap) map[string]string

Types

type Config

type Config struct {
	SecretKey string `json:"secretKey" yaml:"secretKey"`
	Salt      string `json:"salt" yaml:"salt"`
}

type Login

type Login struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type ReceiveRequest

type ReceiveRequest struct {
	Method    string            `json:"method"`
	Variables datatypes.JSONMap `json:"variables"`
}

func (ReceiveRequest) Validate

func (r ReceiveRequest) Validate() error

func (ReceiveRequest) ValidateFunc

func (r ReceiveRequest) ValidateFunc() func(interface{}) error

type RestySendRequest

type RestySendRequest struct {
	SendBase
	Header map[string]string `json:"header"`
	Query  map[string]string `json:"query"`
	Form   map[string]string `json:"form"`
	Body   map[string]any    `json:"body"`
}

type Rule

type Rule struct {
	RuleItem
	Receive ReceiveRequest `json:"receive" gorm:"embedded;embeddedPrefix:receive_"`
	Send    SendRequest    `json:"send" gorm:"embedded;embeddedPrefix:send_"`
}

func (Rule) Validate

func (r Rule) Validate() error

type RuleItem

type RuleItem struct {
	gorm.Model
	UID         string `json:"uid" gorm:"unique,not null"`
	Name        string `json:"name" gorm:"unique,not null"`
	Description string `json:"description"`
	GroupId     string `json:"groupId"`
	IsAuth      bool   `json:"isAuth"`
	IsForward   bool   `json:"isForward"`
}

func (RuleItem) Validate

func (r RuleItem) Validate() error

func (RuleItem) ValidateFunc

func (r RuleItem) ValidateFunc() func(any) error

type SendBase

type SendBase struct {
	Url    string `json:"url"`
	Method string `json:"method"`
	IsForm bool   `json:"isForm"`
}

type SendRequest

type SendRequest struct {
	SendBase
	Header datatypes.JSONMap `json:"header"`
	Query  datatypes.JSONMap `json:"query"`
	Form   datatypes.JSONMap `json:"form"`
	Body   datatypes.JSONMap `json:"body"`
}

func (SendRequest) ToResty

func (r SendRequest) ToResty() RestySendRequest

func (SendRequest) Validate

func (r SendRequest) Validate() error

func (SendRequest) ValidateFunc

func (r SendRequest) ValidateFunc() func(interface{}) error

type User

type User struct {
	gorm.Model
	UID       string `json:"uid" gorm:"unique,not null"`
	Username  string `json:"username" gorm:"unique,not null"`
	Password  string `json:"-,"`
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
}

type UserCreateRequest

type UserCreateRequest struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

func (UserCreateRequest) Validate

func (r UserCreateRequest) Validate() error

type UserResetPasswordRequest

type UserResetPasswordRequest struct {
	Password    string `json:"password" binding:"required"`
	NewPassword string `json:"new_password" binding:"required"`
}

func (UserResetPasswordRequest) Validate

func (r UserResetPasswordRequest) Validate() error

type UserUpdateRequest

type UserUpdateRequest struct {
	Username string `json:"username" binding:"required"`
}

func (UserUpdateRequest) Validate

func (r UserUpdateRequest) Validate() error

type VariableItem

type VariableItem struct {
	Key      string `json:"key"`
	Assign   string `json:"assign"`
	Validate string `json:"validate"`
	Value    string `json:"-"`
	Type     string `json:"-"`
}

Jump to

Keyboard shortcuts

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