repository

package
v0.0.0-...-6d513be Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostRepository

type HostRepository interface {
	Create(ctx context.Context, host *entity.Host) (*entity.Host, error)
	Get(ctx context.Context, id string) (*entity.Host, error)
	Update(ctx context.Context, host *entity.Host) (*entity.Host, error)
	Delete(ctx context.Context, id string) error
	Find(ctx context.Context, options *entity.HostFindOptions) ([]*entity.Host, error)

	GetHostByEnrollCode(ctx context.Context, code string) (*entity.Host, error)

	// GetEnrollHost 获取主机的注册信息
	GetEnrollHost(ctx context.Context, getEnrollHost *entity.GetEnrollHost) (*entity.EnrollHost, error)
	// EnrollHost 注册主机
	EnrollHost(ctx context.Context, enrollHost *entity.EnrollHost) error

	// HostOnline 主机上线
	HostOnline(ctx context.Context, hostOnline *entity.HostOnline) (*entity.HostOnline, error)
	// HostOffline 主机下线
	HostOffline(ctx context.Context, hostOffline *entity.HostOffline) (*entity.HostOffline, error)
}

HostRepository 定义了对主机数据的存储和操作接口

type HostRuleRepository

type HostRuleRepository interface {
	DeleteHostRule(ctx context.Context, hostID string, ruleID ...string) error
	AddHostRule(ctx context.Context, hostID string, ruleID ...string) error
	ListHostRule(ctx context.Context, opts *entity.ListHostRuleOptions) ([]*entity.HostRuleRelation, error)
}

type RuleRepository

type RuleRepository interface {
	Create(ctx context.Context, userID string, rule *entity.Rule) (*entity.Rule, error)
	Get(ctx context.Context, userID, id string) (*entity.Rule, error)
	Gets(ctx context.Context, userID string, id []string) ([]*entity.Rule, error)

	Update(ctx context.Context, userID string, rule *entity.Rule) error
	Delete(ctx context.Context, id string) error
	Find(ctx context.Context, userID string, options *entity.RuleFindOptions) ([]*entity.Rule, error)
}

Jump to

Keyboard shortcuts

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