Documentation
¶
Index ¶
- func CORSMiddleware() gin.HandlerFunc
- func NewAuthMiddleware(server *Server, realm, secretKey string) (*jwt.GinJWTMiddleware, error)
- func Register(hook Hook)
- type ClusterDTO
- type ConfigService
- type GroupDTO
- type Handler
- type Hook
- type LoginPayload
- type MyConfigService
- func (cs *MyConfigService) BindNode(ctx context.Context, tenant, cluster, group, node string) error
- func (cs *MyConfigService) ListClusters(ctx context.Context, tenant string) ([]*ClusterDTO, error)
- func (cs *MyConfigService) ListDBGroups(ctx context.Context, tenant, cluster string) ([]*GroupDTO, error)
- func (cs *MyConfigService) ListNodes(ctx context.Context, tenant string) ([]*NodeDTO, error)
- func (cs *MyConfigService) ListTables(ctx context.Context, tenant, cluster string) ([]*TableDTO, error)
- func (cs *MyConfigService) ListTenants(ctx context.Context) ([]*TenantDTO, error)
- func (cs *MyConfigService) RemoveCluster(ctx context.Context, tenant, cluster string) error
- func (cs *MyConfigService) RemoveGroup(ctx context.Context, tenant, cluster, group string) error
- func (cs *MyConfigService) RemoveNode(ctx context.Context, tenant, node string) error
- func (cs *MyConfigService) RemoveTable(ctx context.Context, tenant, cluster, table string) error
- func (cs *MyConfigService) RemoveTenant(ctx context.Context, tenant string) error
- func (cs *MyConfigService) RemoveUser(ctx context.Context, tenant string, username string) error
- func (cs *MyConfigService) UnbindNode(ctx context.Context, tenant, cluster, group, node string) error
- func (cs *MyConfigService) UpsertCluster(ctx context.Context, tenant, cluster string, body *ClusterDTO) error
- func (cs *MyConfigService) UpsertGroup(ctx context.Context, tenant, cluster, group string, body *GroupDTO) error
- func (cs *MyConfigService) UpsertNode(ctx context.Context, tenant, node string, body *NodeDTO) error
- func (cs *MyConfigService) UpsertTable(ctx context.Context, tenant, cluster, table string, body *TableDTO) error
- func (cs *MyConfigService) UpsertTenant(ctx context.Context, tenant string, body *TenantDTO) error
- func (cs *MyConfigService) UpsertUser(ctx context.Context, tenant string, user *config.User, username string) error
- type NodeDTO
- type Router
- type Server
- type ServiceDiscovery
- type ServiceInstanceDTO
- type TableDTO
- type TenantDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶
func CORSMiddleware() gin.HandlerFunc
func NewAuthMiddleware ¶
func NewAuthMiddleware(server *Server, realm, secretKey string) (*jwt.GinJWTMiddleware, error)
Types ¶
type ClusterDTO ¶
type ClusterDTO struct { Name string `json:"name,omitempty"` Type config.DataSourceType `json:"type"` SqlMaxLimit int `json:"sql_max_limit,omitempty"` Parameters config.ParametersMap `json:"parameters,omitempty"` Groups []string `json:"groups"` }
type ConfigService ¶
type ConfigService interface {
// contains filtered or unexported methods
}
ConfigService represents a service to read/write configurations.
func GetService ¶
func GetService(c *gin.Context) ConfigService
GetService returns ConfigService from gin context.
type LoginPayload ¶
type MyConfigService ¶
type MyConfigService struct { TenantOp config.TenantOperator // contains filtered or unexported fields }
func (*MyConfigService) BindNode ¶
func (cs *MyConfigService) BindNode(ctx context.Context, tenant, cluster, group, node string) error
func (*MyConfigService) ListClusters ¶
func (cs *MyConfigService) ListClusters(ctx context.Context, tenant string) ([]*ClusterDTO, error)
func (*MyConfigService) ListDBGroups ¶
func (*MyConfigService) ListTables ¶
func (*MyConfigService) ListTenants ¶
func (cs *MyConfigService) ListTenants(ctx context.Context) ([]*TenantDTO, error)
func (*MyConfigService) RemoveCluster ¶
func (cs *MyConfigService) RemoveCluster(ctx context.Context, tenant, cluster string) error
func (*MyConfigService) RemoveGroup ¶
func (cs *MyConfigService) RemoveGroup(ctx context.Context, tenant, cluster, group string) error
func (*MyConfigService) RemoveNode ¶
func (cs *MyConfigService) RemoveNode(ctx context.Context, tenant, node string) error
func (*MyConfigService) RemoveTable ¶
func (cs *MyConfigService) RemoveTable(ctx context.Context, tenant, cluster, table string) error
func (*MyConfigService) RemoveTenant ¶
func (cs *MyConfigService) RemoveTenant(ctx context.Context, tenant string) error
func (*MyConfigService) RemoveUser ¶
func (*MyConfigService) UnbindNode ¶
func (cs *MyConfigService) UnbindNode(ctx context.Context, tenant, cluster, group, node string) error
func (*MyConfigService) UpsertCluster ¶
func (cs *MyConfigService) UpsertCluster(ctx context.Context, tenant, cluster string, body *ClusterDTO) error
func (*MyConfigService) UpsertGroup ¶
func (*MyConfigService) UpsertNode ¶
func (*MyConfigService) UpsertTable ¶
func (*MyConfigService) UpsertTenant ¶
func (*MyConfigService) UpsertUser ¶
type NodeDTO ¶
type NodeDTO struct { Name string `json:"name,omitempty"` Host string `json:"host"` Port int `json:"port"` Username string `json:"username"` Password string `json:"password"` Database string `json:"database"` Weight string `json:"weight"` Parameters config.ParametersMap `json:"parameters,omitempty"` ConnProps map[string]interface{} `json:"conn_props,omitempty"` Labels map[string]string `json:"labels,omitempty"` }
type ServiceDiscovery ¶
type ServiceDiscovery interface {
ListServices() []*ServiceInstanceDTO
}
func GetServiceDiscovery ¶
func GetServiceDiscovery(c *gin.Context) ServiceDiscovery
GetServiceDiscovery returns ConfigService from gin context.
type ServiceInstanceDTO ¶
type ServiceInstanceDTO struct { // ID is the unique instance ID as registered. ID string `json:"id"` // Name is the service name as registered. Name string `json:"name"` // Version is the version of the compiled. Version string `json:"version"` // Endpoint addresses of the service instance. Endpoint *config.Listener }
type TableDTO ¶
type TableDTO struct { Name string `json:"name,omitempty"` Sequence *config.Sequence `json:"sequence,omitempty"` AllowFullScan bool `json:"allow_full_scan,omitempty"` DbRules []*config.Rule `json:"db_rules,omitempty"` TblRules []*config.Rule `json:"tbl_rules,omitempty"` Topology *config.Topology `json:"topology,omitempty"` ShadowTopology *config.Topology `json:"shadow_topology,omitempty"` Attributes map[string]string `json:"attributes,omitempty"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.