Documentation
¶
Index ¶
- func NewStore()
- 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 CleanDuplicateFiringer
- type CleanExpiredSilence
- type CleanExpiredSilencer
- 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) 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) 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) 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 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)
}
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(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)
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) AlertsServicer
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 CleanDuplicateFiringer ¶
type CleanDuplicateFiringer interface {
CleanDuplicateFiringAlertsTask()
}
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 GeneralUserServicer ¶
type GeneralUserServicer interface {
Login(ctx context.Context, req *types.UserLoginRequest) (*types.UserLoginResponse, error)
Logout(ctx context.Context) 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)
}
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) 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) 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) 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.