service

package
v0.0.0-...-95d8435 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = fmt.Errorf("not found")

Functions

This section is empty.

Types

type RuleService

type RuleService struct {
	// contains filtered or unexported fields
}

func NewRuleService

func NewRuleService(db *gorm.DB) *RuleService

func (*RuleService) Create

func (s *RuleService) Create(r *model.Rule) error

func (*RuleService) FindAll

func (s *RuleService) FindAll(ctx context.Context) ([]model.Rule, error)

FindAll returns all rules todo: pagination

func (*RuleService) FindByAddress

func (s *RuleService) FindByAddress(addr types.Address) ([]model.Rule, error)

func (*RuleService) FindByPrimaryKey

func (s *RuleService) FindByPrimaryKey(uid uint, event types.EventType, addr types.Address) (*model.Rule, error)

func (*RuleService) Update

func (s *RuleService) Update(rule *model.Rule) error

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(db *gorm.DB) *UserService

func (*UserService) Create

func (s *UserService) Create(user *model.User) error

func (*UserService) FindByDiscordID

func (s *UserService) FindByDiscordID(id string) (*model.User, error)

func (*UserService) FindOrCreateByDiscordUser

func (s *UserService) FindOrCreateByDiscordUser(du *discordgo.User) (*model.User, error)

Jump to

Keyboard shortcuts

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