service

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 32 Imported by: 0

README

Service

Documentation

Index

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

func AddDefaultAuthHeader(req *http.Request)

func GetTime

func GetTime() int64

get time

func GetUUID

func GetUUID() string

generate uuid

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) Delete

func (c *CoreClient) Delete(url string) ([]byte, error)

func (*CoreClient) Get

func (c *CoreClient) Get(url string) ([]byte, error)

func (*CoreClient) GetCoreUrl

func (c *CoreClient) GetCoreUrl(midUrl string, mapUrl map[string]string, entityType string) string

GetCoreUrl get core url

func (*CoreClient) GetTokenMap

func (c *CoreClient) GetTokenMap(ctx context.Context) (map[string]string, error)

GetTokenMap get token

func (*CoreClient) ParseResp

func (c *CoreClient) ParseResp(resp *http.Response, err error) ([]byte, error)

func (*CoreClient) Patch

func (c *CoreClient) Patch(url string, data []byte) ([]byte, error)

func (*CoreClient) Post

func (c *CoreClient) Post(url string, data []byte) ([]byte, error)

func (*CoreClient) Put

func (c *CoreClient) Put(url string, data []byte) ([]byte, error)

func (*CoreClient) User

func (c *CoreClient) User(ctx context.Context) (*User, error)

User get Auth user info

type DaprSubscribeService

type DaprSubscribeService struct {
	pb.UnimplementedSubscribeServer
}

func NewDaprSubscribeService

func NewDaprSubscribeService() *DaprSubscribeService

func (*DaprSubscribeService) GetSubscribe

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

AddonsIdentify implements AddonsIdentify.OpenapiServer.

func (*OpenapiService) Identify

Identify implements Identify.OpenapiServer.

func (*OpenapiService) Status

Status implements Status.OpenapiServer.

func (*OpenapiService) TenantDisable

TenantDisable implements TenantDisable.OpenapiServer.

func (*OpenapiService) TenantEnable

TenantEnable implements TenantEnable.OpenapiServer.

type SubscribeService

type SubscribeService struct {
	pb.UnimplementedSubscribeServer
}

func NewSubscribeService

func NewSubscribeService() *SubscribeService

func (*SubscribeService) ChangeSubscribed

func (*SubscribeService) CreateSubscribe

func (*SubscribeService) DeleteSubscribe

func (*SubscribeService) GetSubscribe

func (*SubscribeService) ListSubscribe

func (*SubscribeService) ListSubscribeEntities

func (*SubscribeService) SubscribeByDevice

func (*SubscribeService) SubscribeEntitiesByIDs

func (*SubscribeService) UnsubscribeEntitiesByIDs

func (*SubscribeService) UpdateSubscribe

func (*SubscribeService) ValidateSubscribed

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)

type User

type User struct {
	ID       string `json:"id"`
	TenantID string `json:"tenant_id"`
	Token    string `json:"token"`
}

Jump to

Keyboard shortcuts

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