Documentation ¶
Index ¶
- Constants
- Variables
- func AddDefaultAuthHeader(req *http.Request)
- func GetTime() int64
- func GetUUID() string
- type CoreClient
- func (c *CoreClient) CreatEntityToken(entityType, id, owner string, token string) (string, error)
- func (c *CoreClient) Delete(url string) ([]byte, error)
- func (c *CoreClient) Get(url string) ([]byte, error)
- func (c *CoreClient) GetCoreUrl(midUrl string, mapUrl map[string]string, entityType string) string
- func (c *CoreClient) GetTokenMap(ctx context.Context) (map[string]string, error)
- func (c *CoreClient) ParseResp(resp *http.Response, err error) ([]byte, error)
- func (c *CoreClient) Patch(url string, data []byte) ([]byte, error)
- func (c *CoreClient) Post(url string, data []byte) ([]byte, error)
- func (c *CoreClient) Put(url string, data []byte) ([]byte, error)
- func (c *CoreClient) User(ctx context.Context) (*User, error)
- type DaprSubscribeService
- type EntityService
- type OpenapiService
- func (s *OpenapiService) AddonsIdentify(ctx context.Context, in *openapi_v1.AddonsIdentifyRequest) (*openapi_v1.AddonsIdentifyResponse, error)
- func (s *OpenapiService) Identify(ctx context.Context, in *emptypb.Empty) (*openapi_v1.IdentifyResponse, error)
- func (s *OpenapiService) Status(ctx context.Context, in *emptypb.Empty) (*openapi_v1.StatusResponse, error)
- func (s *OpenapiService) TenantDisable(ctx context.Context, in *openapi_v1.TenantDisableRequest) (*openapi_v1.TenantDisableResponse, error)
- func (s *OpenapiService) TenantEnable(ctx context.Context, in *openapi_v1.TenantEnableRequest) (*openapi_v1.TenantEnableResponse, error)
- type SubscribeService
- func (s *SubscribeService) ChangeSubscribed(ctx context.Context, req *pb.ChangeSubscribedRequest) (*pb.ChangeSubscribedResponse, error)
- func (s *SubscribeService) CreateSubscribe(ctx context.Context, req *pb.CreateSubscribeRequest) (*pb.CreateSubscribeResponse, error)
- func (s *SubscribeService) DeleteSubscribe(ctx context.Context, req *pb.DeleteSubscribeRequest) (*pb.DeleteSubscribeResponse, error)
- func (s *SubscribeService) GetSubscribe(ctx context.Context, req *pb.GetSubscribeRequest) (*pb.GetSubscribeResponse, error)
- func (s *SubscribeService) ListSubscribe(ctx context.Context, req *pb.ListSubscribeRequest) (*pb.ListSubscribeResponse, error)
- func (s *SubscribeService) ListSubscribeEntities(ctx context.Context, req *pb.ListSubscribeEntitiesRequest) (*pb.ListSubscribeEntitiesResponse, error)
- func (s *SubscribeService) SubscribeByDevice(ctx context.Context, req *pb.SubscribeByDeviceRequest) (*pb.SubscribeByDeviceResponse, error)
- func (s *SubscribeService) SubscribeEntitiesByGroups(ctx context.Context, req *pb.SubscribeEntitiesByGroupsRequest) (*pb.SubscribeEntitiesByGroupsResponse, error)
- func (s *SubscribeService) SubscribeEntitiesByIDs(ctx context.Context, req *pb.SubscribeEntitiesByIDsRequest) (*pb.SubscribeEntitiesByIDsResponse, error)
- func (s *SubscribeService) SubscribeEntitiesByModels(ctx context.Context, req *pb.SubscribeEntitiesByModelsRequest) (*pb.SubscribeEntitiesByModelsResponse, error)
- func (s *SubscribeService) UnsubscribeEntitiesByIDs(ctx context.Context, req *pb.UnsubscribeEntitiesByIDsRequest) (*pb.UnsubscribeEntitiesByIDsResponse, error)
- func (s *SubscribeService) UpdateSubscribe(ctx context.Context, req *pb.UpdateSubscribeRequest) (*pb.UpdateSubscribeResponse, error)
- func (s *SubscribeService) ValidateSubscribed(ctx context.Context, req *pb.ValidateSubscribedRequest) (*pb.ValidateSubscribedResponse, error)
- type TopicService
- type User
Constants ¶
View Source
const ( Owner = "owner" Source = "source" UserToken = "user_token" SubscribePath = "sysField._subscribeAddr" )
View Source
const ( SuccessStatus = "SUCCESS" ErrPartialFailure = "PARTIAL FAILURE" )
View Source
const ( // SubscriptionResponseStatusSuccess means message is processed successfully. SubscriptionResponseStatusSuccess = "SUCCESS" // SubscriptionResponseStatusRetry means message to be retried by Dapr. SubscriptionResponseStatusRetry = "RETRY" // SubscriptionResponseStatusDrop means warning is logged and message is dropped. SubscriptionResponseStatusDrop = "DROP" )
Variables ¶
View Source
var (
ErrDeviceNotFound = errors.New("device not found")
)
Functions ¶
func AddDefaultAuthHeader ¶
Types ¶
type CoreClient ¶
type CoreClient struct { }
func NewCoreClient ¶
func NewCoreClient() *CoreClient
func (*CoreClient) CreatEntityToken ¶
func (c *CoreClient) CreatEntityToken(entityType, id, owner string, token string) (string, error)
func (*CoreClient) GetCoreUrl ¶
GetCoreUrl get core url
func (*CoreClient) GetTokenMap ¶
GetTokenMap get token
type DaprSubscribeService ¶
type DaprSubscribeService struct {
pb.UnimplementedSubscribeServer
}
func NewDaprSubscribeService ¶
func NewDaprSubscribeService() *DaprSubscribeService
func (*DaprSubscribeService) GetSubscribe ¶
func (s *DaprSubscribeService) GetSubscribe(ctx context.Context, req *emptypb.Empty) (*pb.ListTopicSubscriptionsResponse, error)
type EntityService ¶
type EntityService struct {
// contains filtered or unexported fields
}
func NewEntityService ¶
func NewEntityService() *EntityService
func (*EntityService) GetEntity ¶
func (s *EntityService) GetEntity(req *go_restful.Request, resp *go_restful.Response)
func (*EntityService) Run ¶
func (s *EntityService) Run()
type OpenapiService ¶
type OpenapiService struct {
v1.UnimplementedOpenapiServer
}
OpenapiService is a openapi service.
func NewOpenapiService ¶
func NewOpenapiService() *OpenapiService
NewOpenapiService new a openapi service.
func (*OpenapiService) AddonsIdentify ¶
func (s *OpenapiService) AddonsIdentify(ctx context.Context, in *openapi_v1.AddonsIdentifyRequest) (*openapi_v1.AddonsIdentifyResponse, error)
AddonsIdentify implements AddonsIdentify.OpenapiServer.
func (*OpenapiService) Identify ¶
func (s *OpenapiService) Identify(ctx context.Context, in *emptypb.Empty) (*openapi_v1.IdentifyResponse, error)
Identify implements Identify.OpenapiServer.
func (*OpenapiService) Status ¶
func (s *OpenapiService) Status(ctx context.Context, in *emptypb.Empty) (*openapi_v1.StatusResponse, error)
Status implements Status.OpenapiServer.
func (*OpenapiService) TenantDisable ¶
func (s *OpenapiService) TenantDisable(ctx context.Context, in *openapi_v1.TenantDisableRequest) (*openapi_v1.TenantDisableResponse, error)
TenantDisable implements TenantDisable.OpenapiServer.
func (*OpenapiService) TenantEnable ¶
func (s *OpenapiService) TenantEnable(ctx context.Context, in *openapi_v1.TenantEnableRequest) (*openapi_v1.TenantEnableResponse, error)
TenantEnable implements TenantEnable.OpenapiServer.
type SubscribeService ¶
type SubscribeService struct {
pb.UnimplementedSubscribeServer
}
func NewSubscribeService ¶
func NewSubscribeService() *SubscribeService
func (*SubscribeService) ChangeSubscribed ¶
func (s *SubscribeService) ChangeSubscribed(ctx context.Context, req *pb.ChangeSubscribedRequest) (*pb.ChangeSubscribedResponse, error)
func (*SubscribeService) CreateSubscribe ¶
func (s *SubscribeService) CreateSubscribe(ctx context.Context, req *pb.CreateSubscribeRequest) (*pb.CreateSubscribeResponse, error)
func (*SubscribeService) DeleteSubscribe ¶
func (s *SubscribeService) DeleteSubscribe(ctx context.Context, req *pb.DeleteSubscribeRequest) (*pb.DeleteSubscribeResponse, error)
func (*SubscribeService) GetSubscribe ¶
func (s *SubscribeService) GetSubscribe(ctx context.Context, req *pb.GetSubscribeRequest) (*pb.GetSubscribeResponse, error)
func (*SubscribeService) ListSubscribe ¶
func (s *SubscribeService) ListSubscribe(ctx context.Context, req *pb.ListSubscribeRequest) (*pb.ListSubscribeResponse, error)
func (*SubscribeService) ListSubscribeEntities ¶
func (s *SubscribeService) ListSubscribeEntities(ctx context.Context, req *pb.ListSubscribeEntitiesRequest) (*pb.ListSubscribeEntitiesResponse, error)
func (*SubscribeService) SubscribeByDevice ¶
func (s *SubscribeService) SubscribeByDevice(ctx context.Context, req *pb.SubscribeByDeviceRequest) (*pb.SubscribeByDeviceResponse, error)
func (*SubscribeService) SubscribeEntitiesByGroups ¶
func (s *SubscribeService) SubscribeEntitiesByGroups(ctx context.Context, req *pb.SubscribeEntitiesByGroupsRequest) (*pb.SubscribeEntitiesByGroupsResponse, error)
func (*SubscribeService) SubscribeEntitiesByIDs ¶
func (s *SubscribeService) SubscribeEntitiesByIDs(ctx context.Context, req *pb.SubscribeEntitiesByIDsRequest) (*pb.SubscribeEntitiesByIDsResponse, error)
func (*SubscribeService) SubscribeEntitiesByModels ¶
func (s *SubscribeService) SubscribeEntitiesByModels(ctx context.Context, req *pb.SubscribeEntitiesByModelsRequest) (*pb.SubscribeEntitiesByModelsResponse, error)
func (*SubscribeService) UnsubscribeEntitiesByIDs ¶
func (s *SubscribeService) UnsubscribeEntitiesByIDs(ctx context.Context, req *pb.UnsubscribeEntitiesByIDsRequest) (*pb.UnsubscribeEntitiesByIDsResponse, error)
func (*SubscribeService) UpdateSubscribe ¶
func (s *SubscribeService) UpdateSubscribe(ctx context.Context, req *pb.UpdateSubscribeRequest) (*pb.UpdateSubscribeResponse, error)
func (*SubscribeService) ValidateSubscribed ¶
func (s *SubscribeService) ValidateSubscribed(ctx context.Context, req *pb.ValidateSubscribedRequest) (*pb.ValidateSubscribedResponse, error)
type TopicService ¶
type TopicService struct {
pb.UnimplementedTopicServer
}
func NewTopicService ¶
func NewTopicService() *TopicService
func (*TopicService) TopicEventHandler ¶
func (s *TopicService) TopicEventHandler(ctx context.Context, req *pb.TopicEventRequest) (*pb.TopicEventResponse, error)
Click to show internal directories.
Click to hide internal directories.