status-go/protocol/requests/create_community_category.go
Pascal Precht f31e40264e refactor(import-tool): process import data in chunks
This commit refactors the discord import tool such that,
instead of loading all data to be imported into memory at
once, it will now perform the import on a per file basis.

This improves the memory pressure for the node performing
the import and seems to increase its performance as well.
2023-01-30 12:23:56 +01:00

30 lines
797 B
Go

package requests
import (
"errors"
"github.com/status-im/status-go/eth-node/types"
)
var ErrCreateCommunityCategoryInvalidCommunityID = errors.New("create-community-category: invalid community id")
var ErrCreateCommunityCategoryInvalidName = errors.New("create-community-category: invalid category name")
type CreateCommunityCategory struct {
CommunityID types.HexBytes `json:"communityId"`
CategoryName string `json:"categoryName"`
ChatIDs []string `json:"chatIds"`
ThirdPartyID string `json:"thirdPartyID,omitempty"`
}
func (j *CreateCommunityCategory) Validate() error {
if len(j.CommunityID) == 0 {
return ErrCreateCommunityCategoryInvalidCommunityID
}
if len(j.CategoryName) == 0 {
return ErrCreateCommunityCategoryInvalidName
}
return nil
}