Documentation
¶
Index ¶
- func NewStore()
- type AgentCommand
- type AlertChannelServicer
- type AlertHistoryServicer
- type AlertInhibiter
- type AlertSilenceServicer
- type AlertTemplateServicer
- type AlertsServicer
- type ApiService
- func (receiver *ApiService) CreateApi(ctx context.Context, req *types.ApiCreateRequest) (err error)
- func (receiver *ApiService) DeleteApi(ctx context.Context, req *types.IDRequest) (err error)
- func (receiver *ApiService) ListApi(ctx context.Context, req *types.ApiListRequest) (res *types.ApiListResponse, err error)
- func (receiver *ApiService) QueryApi(ctx context.Context, req *types.IDRequest) (api *model.Api, err error)
- func (receiver *ApiService) UpdateApi(ctx context.Context, req *types.ApiUpdateRequest) (err error)
- type ApiServicer
- type CacheAlertNameOptioner
- type CleanDuplicateFiringer
- type CleanExpiredSilence
- type CleanExpiredSilencer
- type CleanStaleCacher
- type ClusterAgent
- type DataTunnelService
- func (s *DataTunnelService) ExecuteCommandLocally(ctx context.Context, req *types.InternalForwardReq) (*pb.CommandResult, error)
- func (s *DataTunnelService) HandleCommandResult(_ context.Context, _ string, requestID string, result *pb.CommandResult) error
- func (s *DataTunnelService) RegisterAgent(ctx context.Context, init *pb.Init) (chan *AgentCommand, error)
- func (s *DataTunnelService) SendCommandAndWait(ctx context.Context, req *types.SendCommandAndWaitReq) (*pb.CommandResult, error)
- func (s *DataTunnelService) UnregisterAgent(_ context.Context, agentID string, clusterID string, ch chan *AgentCommand) error
- type DataTunnelServicer
- type GeneralUserServicer
- type OAuthServicer
- type RoleServicer
- type TenantService
- func (receiver *TenantService) CreateTenant(ctx context.Context, req *types.TenantCreateRequest) error
- func (receiver *TenantService) DeleteTenant(ctx context.Context, req *types.IDRequest) error
- func (receiver *TenantService) GetTenantOption(ctx context.Context) ([]*types.TenantOption, error)
- func (receiver *TenantService) ListTenant(ctx context.Context, req *types.TenantListRequest) (*types.TenantListResponse, error)
- func (receiver *TenantService) QueryTenant(ctx context.Context, req *types.IDRequest) (*model.Tenant, error)
- func (receiver *TenantService) UpdateTenant(ctx context.Context, req *types.TenantUpdateRequest) error
- type TenantServicer
- type UserService
- func (receiver *UserService) CreateUser(ctx context.Context, req *types.UserCreateRequest) (err error)
- func (receiver *UserService) DeleteUser(ctx context.Context, req *types.IDRequest) (err error)
- func (receiver *UserService) GetUserOptions(ctx context.Context) ([]types.Option, error)
- func (receiver *UserService) Info(ctx context.Context) (*model.User, error)
- func (receiver *UserService) ListUser(ctx context.Context, req *types.UserListRequest) (*types.UserListResponse, error)
- func (receiver *UserService) Login(ctx context.Context, req *types.UserLoginRequest) (*types.UserLoginResponse, error)
- func (receiver *UserService) Logout(ctx context.Context, req *types.RefreshTokenRequest) error
- func (receiver *UserService) OAuth2Activate(ctx context.Context, req *types.OAuthActivateRequest) (*types.UserLoginResponse, error)
- func (receiver *UserService) OAuth2Callback(ctx context.Context, req *types.OAuthLoginRequest) (*types.UserLoginResponse, error)
- func (receiver *UserService) OAuth2Login(provider, state string) (string, error)
- func (receiver *UserService) OAuth2Provider(_ context.Context) ([]string, error)
- func (receiver *UserService) QueryUser(ctx context.Context, req *types.IDRequest) (*model.User, error)
- func (receiver *UserService) RefreshToken(ctx context.Context, req *types.RefreshTokenRequest) (*types.UserLoginResponse, error)
- func (receiver *UserService) UpdateUserByAdmin(ctx context.Context, req *types.UserUpdateAdminRequest) error
- func (receiver *UserService) UpdateUserBySelf(ctx context.Context, req *types.UserUpdateSelfRequest) error
- type UserServicer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentCommand ¶
AgentCommand wraps a command with an optional request ID.
type AlertChannelServicer ¶
type AlertChannelServicer interface {
CreateAlerChannel(ctx context.Context, req *types.AlertChannelCreateRequest) error
UpdateChannel(ctx context.Context, req *types.AlertChannelUpdateRequest) error
DeleteChannel(ctx context.Context, req *types.IDRequest) error
QueryChannel(ctx context.Context, req *types.IDRequest) (*model.AlertChannel, error)
ListChannel(ctx context.Context, req *types.AlertChannelListRequest) (*types.AlertChannelListResponse, error)
}
func NewChannelServicer ¶
func NewChannelServicer(cache store.CacheStorer) AlertChannelServicer
type AlertHistoryServicer ¶
type AlertHistoryServicer interface {
QueryHistory(ctx context.Context, req *types.IDRequest) (*model.AlertHistory, error)
UpdateHistory(ctx context.Context, req *types.AlertHistoryUpdateRequest) error
ListHistory(ctx context.Context, req *types.AlertHistoryListRequest) (*types.AlertHistoryListResponse, error)
GetTenantFiringCounts(ctx context.Context) ([]*types.TenantCount, error)
CacheAlertNameOptioner
}
func NewHistoryServicer ¶
func NewHistoryServicer(cache store.CacheStorer) AlertHistoryServicer
type AlertInhibiter ¶
type AlertInhibiter interface {
CleanInhibitAlert()
}
func NewalertInhibit ¶
func NewalertInhibit(inhibitMatchers []*alertinhibit.InhibitMatcher, cache store.CacheStorer) AlertInhibiter
type AlertSilenceServicer ¶
type AlertSilenceServicer interface {
CreateSilence(ctx context.Context, req *types.AlertSilenceCreateRequest) error
DeleteSilence(ctx context.Context, req *types.IDRequest) error
QuerySilence(ctx context.Context, req *types.IDRequest) (*model.AlertSilence, error)
ListSilence(ctx context.Context, req *types.AlertSilenceListRequest) (*types.AlertSilenceListResponse, error)
GetTenantSilenceCounts(ctx context.Context) ([]*types.TenantCount, error)
}
func NewAlertSilenceServicer ¶
func NewAlertSilenceServicer(cache store.CacheStorer, jwt jwt.JwtInterface) AlertSilenceServicer
type AlertTemplateServicer ¶
type AlertTemplateServicer interface {
CreateAlerTemplate(ctx context.Context, req *types.AlertTemplateCreateRequest) error
UpdateTemplate(ctx context.Context, req *types.AlertTemplateUpdateRequest) error
DeleteTemplate(ctx context.Context, req *types.IDRequest) error
QueryTemplate(ctx context.Context, req *types.IDRequest) (*model.AlertTemplate, error)
CopyTemplate(ctx context.Context, req *types.AlertTemplateCopyRequest) (*model.AlertTemplate, error)
ListTemplate(ctx context.Context, req *types.AlertTemplateListRequest) (*types.AlertTemplateListResponse, error)
}
func NewAlertTemplateServicer ¶
func NewAlertTemplateServicer(cache store.CacheStorer) AlertTemplateServicer
type AlertsServicer ¶
type AlertsServicer interface {
SendAlert(ctx context.Context, req *types.AlertReceiveReq) error
IsSilenced(ctx context.Context, alert *types.Alert, activeSilences []*model.AlertSilence) (bool, int)
}
func NewAlertsServicer ¶
func NewAlertsServicer(cache store.CacheStorer, feishuImpl feishu.Feishuer, emailImpl email.Emailer) (AlertsServicer, error)
type ApiService ¶
type ApiService struct{}
func (*ApiService) CreateApi ¶
func (receiver *ApiService) CreateApi(ctx context.Context, req *types.ApiCreateRequest) (err error)
func (*ApiService) ListApi ¶
func (receiver *ApiService) ListApi(ctx context.Context, req *types.ApiListRequest) (res *types.ApiListResponse, err error)
func (*ApiService) UpdateApi ¶
func (receiver *ApiService) UpdateApi(ctx context.Context, req *types.ApiUpdateRequest) (err error)
type ApiServicer ¶
type ApiServicer interface {
CreateApi(ctx context.Context, req *types.ApiCreateRequest) error
UpdateApi(ctx context.Context, req *types.ApiUpdateRequest) error
DeleteApi(ctx context.Context, req *types.IDRequest) error
QueryApi(ctx context.Context, req *types.IDRequest) (*model.Api, error)
ListApi(ctx context.Context, pagination *types.ApiListRequest) (*types.ApiListResponse, error)
}
func NewApiServicer ¶
func NewApiServicer() ApiServicer
type CacheAlertNameOptioner ¶
type CacheAlertNameOptioner interface {
GetAlertNameOptions(ctx context.Context) ([]types.Option, error)
CacheAlertNameOptions()
}
func NewCacheAlertNameOptioner ¶
func NewCacheAlertNameOptioner(cache store.CacheStorer) CacheAlertNameOptioner
type CleanDuplicateFiringer ¶
type CleanDuplicateFiringer interface {
CleanDuplicateFiringAlertsTask()
CleanRepeatIntervalAlertsTask()
}
func NewCleanDuplicateFiringer ¶
func NewCleanDuplicateFiringer(cache store.CacheStorer) CleanDuplicateFiringer
type CleanExpiredSilence ¶
type CleanExpiredSilence struct {
// contains filtered or unexported fields
}
func (*CleanExpiredSilence) CleanExpiredSilencesTask ¶
func (recevicer *CleanExpiredSilence) CleanExpiredSilencesTask()
CleanExpiredSilencesTask 定时任务:清理过期的静默规则
type CleanExpiredSilencer ¶
type CleanExpiredSilencer interface {
CleanExpiredSilencesTask()
}
func NewCleanExpiredSilencer ¶
func NewCleanExpiredSilencer(cache store.CacheStorer) CleanExpiredSilencer
type CleanStaleCacher ¶
type CleanStaleCacher interface {
CleanStaleCacheTask()
}
func NewCleanStaleCacher ¶
func NewCleanStaleCacher(cache store.CacheStorer) CleanStaleCacher
type ClusterAgent ¶
type ClusterAgent struct {
AgentID string
Ch chan *AgentCommand
}
ClusterAgent represents an agent connection within a cluster.
type DataTunnelService ¶
type DataTunnelService struct {
// contains filtered or unexported fields
}
DataTunnelService implements DataTunnelServicer.
func (*DataTunnelService) ExecuteCommandLocally ¶
func (s *DataTunnelService) ExecuteCommandLocally(ctx context.Context, req *types.InternalForwardReq) (*pb.CommandResult, error)
func (*DataTunnelService) HandleCommandResult ¶
func (s *DataTunnelService) HandleCommandResult(_ context.Context, _ string, requestID string, result *pb.CommandResult) error
func (*DataTunnelService) RegisterAgent ¶
func (s *DataTunnelService) RegisterAgent(ctx context.Context, init *pb.Init) (chan *AgentCommand, error)
func (*DataTunnelService) SendCommandAndWait ¶
func (s *DataTunnelService) SendCommandAndWait(ctx context.Context, req *types.SendCommandAndWaitReq) (*pb.CommandResult, error)
func (*DataTunnelService) UnregisterAgent ¶
func (s *DataTunnelService) UnregisterAgent(_ context.Context, agentID string, clusterID string, ch chan *AgentCommand) error
type DataTunnelServicer ¶
type DataTunnelServicer interface {
RegisterAgent(ctx context.Context, init *pb.Init) (chan *AgentCommand, error)
UnregisterAgent(ctx context.Context, agentID string, clusterID string, ch chan *AgentCommand) error
HandleCommandResult(ctx context.Context, agentID string, requestID string, result *pb.CommandResult) error
SendCommandAndWait(ctx context.Context, req *types.SendCommandAndWaitReq) (*pb.CommandResult, error)
ExecuteCommandLocally(ctx context.Context, req *types.InternalForwardReq) (*pb.CommandResult, error)
}
DataTunnelServicer defines the data tunnel service interface.
func NewDataTunnelService ¶
func NewDataTunnelService(cacheStore store.CacheStorer) DataTunnelServicer
NewDataTunnelService creates a DataTunnelService.
type GeneralUserServicer ¶
type GeneralUserServicer interface {
Login(ctx context.Context, req *types.UserLoginRequest) (*types.UserLoginResponse, error)
RefreshToken(ctx context.Context, req *types.RefreshTokenRequest) (*types.UserLoginResponse, error)
Logout(ctx context.Context, req *types.RefreshTokenRequest) error
Info(ctx context.Context) (*model.User, error)
CreateUser(ctx context.Context, req *types.UserCreateRequest) error
UpdateUserByAdmin(ctx context.Context, req *types.UserUpdateAdminRequest) error
UpdateUserBySelf(ctx context.Context, req *types.UserUpdateSelfRequest) error
DeleteUser(ctx context.Context, req *types.IDRequest) error
QueryUser(ctx context.Context, req *types.IDRequest) (*model.User, error)
ListUser(ctx context.Context, pagination *types.UserListRequest) (*types.UserListResponse, error)
GetUserOptions(ctx context.Context) ([]types.Option, error)
}
type OAuthServicer ¶
type OAuthServicer interface {
OAuth2Provider(ctx context.Context) ([]string, error)
OAuth2Login(provider, state string) (string, error)
OAuth2Callback(ctx context.Context, req *types.OAuthLoginRequest) (*types.UserLoginResponse, error)
OAuth2Activate(ctx context.Context, req *types.OAuthActivateRequest) (*types.UserLoginResponse, error)
}
type RoleServicer ¶
type RoleServicer interface {
CreateRole(ctx context.Context, req *types.RoleCreateRequest) error
UpdateRole(ctx context.Context, req *types.RoleUpdateRequest) error
DeleteRole(ctx context.Context, req *types.IDRequest) error
QueryRole(ctx context.Context, req *types.IDRequest) (*model.Role, error)
ListRole(ctx context.Context, pagination *types.RoleListRequest) (*types.RoleListResponse, error)
}
func NewRoleService ¶
func NewRoleService(casbinManager casbin.CasbinManager) RoleServicer
type TenantService ¶
type TenantService struct {
// contains filtered or unexported fields
}
func (*TenantService) CreateTenant ¶
func (receiver *TenantService) CreateTenant(ctx context.Context, req *types.TenantCreateRequest) error
func (*TenantService) DeleteTenant ¶
func (*TenantService) GetTenantOption ¶
func (receiver *TenantService) GetTenantOption(ctx context.Context) ([]*types.TenantOption, error)
func (*TenantService) ListTenant ¶
func (receiver *TenantService) ListTenant(ctx context.Context, req *types.TenantListRequest) (*types.TenantListResponse, error)
func (*TenantService) QueryTenant ¶
func (*TenantService) UpdateTenant ¶
func (receiver *TenantService) UpdateTenant(ctx context.Context, req *types.TenantUpdateRequest) error
type TenantServicer ¶
type TenantServicer interface {
CreateTenant(ctx context.Context, req *types.TenantCreateRequest) error
UpdateTenant(ctx context.Context, req *types.TenantUpdateRequest) error
DeleteTenant(ctx context.Context, req *types.IDRequest) error
QueryTenant(ctx context.Context, req *types.IDRequest) (*model.Tenant, error)
ListTenant(ctx context.Context, pagination *types.TenantListRequest) (*types.TenantListResponse, error)
GetTenantOption(ctx context.Context) ([]*types.TenantOption, error)
}
func NewTenantServicer ¶
func NewTenantServicer(cacheImpl store.CacheStorer) TenantServicer
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func (*UserService) CreateUser ¶
func (receiver *UserService) CreateUser(ctx context.Context, req *types.UserCreateRequest) (err error)
func (*UserService) DeleteUser ¶
func (*UserService) GetUserOptions ¶
func (*UserService) ListUser ¶
func (receiver *UserService) ListUser(ctx context.Context, req *types.UserListRequest) (*types.UserListResponse, error)
func (*UserService) Login ¶
func (receiver *UserService) Login(ctx context.Context, req *types.UserLoginRequest) (*types.UserLoginResponse, error)
func (*UserService) Logout ¶
func (receiver *UserService) Logout(ctx context.Context, req *types.RefreshTokenRequest) error
func (*UserService) OAuth2Activate ¶
func (receiver *UserService) OAuth2Activate(ctx context.Context, req *types.OAuthActivateRequest) (*types.UserLoginResponse, error)
func (*UserService) OAuth2Callback ¶
func (receiver *UserService) OAuth2Callback(ctx context.Context, req *types.OAuthLoginRequest) (*types.UserLoginResponse, error)
func (*UserService) OAuth2Login ¶
func (receiver *UserService) OAuth2Login(provider, state string) (string, error)
func (*UserService) OAuth2Provider ¶
func (receiver *UserService) OAuth2Provider(_ context.Context) ([]string, error)
func (*UserService) RefreshToken ¶
func (receiver *UserService) RefreshToken(ctx context.Context, req *types.RefreshTokenRequest) (*types.UserLoginResponse, error)
hashPassword 对密码进行 Bcrypt 哈希
func (*UserService) UpdateUserByAdmin ¶
func (receiver *UserService) UpdateUserByAdmin(ctx context.Context, req *types.UserUpdateAdminRequest) error
func (*UserService) UpdateUserBySelf ¶
func (receiver *UserService) UpdateUserBySelf(ctx context.Context, req *types.UserUpdateSelfRequest) error
type UserServicer ¶
type UserServicer interface {
GeneralUserServicer
OAuthServicer
}
func NewUserService ¶
func NewUserService(cacheStore store.CacheStorer, jwt jwt.JwtInterface, feishuOauth *oauth.OAuth2, localCache localcache.Cacher) UserServicer
Click to show internal directories.
Click to hide internal directories.