Documentation
¶
Overview ¶
package magistrala acts as an umbrella package containing multiple different microservices and defines all shared domain concepts.
Index ¶
- Constants
- Variables
- func Health(service, instanceID string) http.HandlerFunc
- func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)
- func RegisterDomainsServiceServer(s grpc.ServiceRegistrar, srv DomainsServiceServer)
- func RegisterThingsServiceServer(s grpc.ServiceRegistrar, srv ThingsServiceServer)
- func RegisterTokenServiceServer(s grpc.ServiceRegistrar, srv TokenServiceServer)
- type AuthNReq
- type AuthNRes
- func (*AuthNRes) Descriptor() ([]byte, []int)deprecated
- func (x *AuthNRes) GetDomainId() string
- func (x *AuthNRes) GetId() string
- func (x *AuthNRes) GetUserId() string
- func (*AuthNRes) ProtoMessage()
- func (x *AuthNRes) ProtoReflect() protoreflect.Message
- func (x *AuthNRes) Reset()
- func (x *AuthNRes) String() string
- type AuthServiceClient
- type AuthServiceServer
- type AuthZReq
- func (*AuthZReq) Descriptor() ([]byte, []int)deprecated
- func (x *AuthZReq) GetDomain() string
- func (x *AuthZReq) GetObject() string
- func (x *AuthZReq) GetObjectType() string
- func (x *AuthZReq) GetPermission() string
- func (x *AuthZReq) GetRelation() string
- func (x *AuthZReq) GetSubject() string
- func (x *AuthZReq) GetSubjectKind() string
- func (x *AuthZReq) GetSubjectRelation() string
- func (x *AuthZReq) GetSubjectType() string
- func (*AuthZReq) ProtoMessage()
- func (x *AuthZReq) ProtoReflect() protoreflect.Message
- func (x *AuthZReq) Reset()
- func (x *AuthZReq) String() string
- type AuthZRes
- type DeleteUserReq
- type DeleteUserRes
- type DomainsServiceClient
- type DomainsServiceServer
- type HealthInfo
- type IDProvider
- type IssueReq
- type RefreshReq
- type Response
- type ThingsAuthzReq
- func (*ThingsAuthzReq) Descriptor() ([]byte, []int)deprecated
- func (x *ThingsAuthzReq) GetChannelId() string
- func (x *ThingsAuthzReq) GetPermission() string
- func (x *ThingsAuthzReq) GetThingId() string
- func (x *ThingsAuthzReq) GetThingKey() string
- func (*ThingsAuthzReq) ProtoMessage()
- func (x *ThingsAuthzReq) ProtoReflect() protoreflect.Message
- func (x *ThingsAuthzReq) Reset()
- func (x *ThingsAuthzReq) String() string
- type ThingsAuthzRes
- func (*ThingsAuthzRes) Descriptor() ([]byte, []int)deprecated
- func (x *ThingsAuthzRes) GetAuthorized() bool
- func (x *ThingsAuthzRes) GetId() string
- func (*ThingsAuthzRes) ProtoMessage()
- func (x *ThingsAuthzRes) ProtoReflect() protoreflect.Message
- func (x *ThingsAuthzRes) Reset()
- func (x *ThingsAuthzRes) String() string
- type ThingsServiceClient
- type ThingsServiceServer
- type Token
- func (*Token) Descriptor() ([]byte, []int)deprecated
- func (x *Token) GetAccessToken() string
- func (x *Token) GetAccessType() string
- func (x *Token) GetRefreshToken() string
- func (*Token) ProtoMessage()
- func (x *Token) ProtoReflect() protoreflect.Message
- func (x *Token) Reset()
- func (x *Token) String() string
- type TokenServiceClient
- type TokenServiceServer
- type UnimplementedAuthServiceServer
- type UnimplementedDomainsServiceServer
- type UnimplementedThingsServiceServer
- type UnimplementedTokenServiceServer
- type UnsafeAuthServiceServer
- type UnsafeDomainsServiceServer
- type UnsafeThingsServiceServer
- type UnsafeTokenServiceServer
Constants ¶
const ( TokenService_Issue_FullMethodName = "/magistrala.TokenService/Issue" TokenService_Refresh_FullMethodName = "/magistrala.TokenService/Refresh" )
const ( AuthService_Authorize_FullMethodName = "/magistrala.AuthService/Authorize" AuthService_Authenticate_FullMethodName = "/magistrala.AuthService/Authenticate" )
const (
DomainsService_DeleteUserFromDomains_FullMethodName = "/magistrala.DomainsService/DeleteUserFromDomains"
)
const (
ThingsService_Authorize_FullMethodName = "/magistrala.ThingsService/Authorize"
)
Variables ¶
var ( // Version represents the last service git tag in git history. // It's meant to be set using go build ldflags: // -ldflags "-X 'github.com/absmach/magistrala.Version=0.0.0'". Version = "0.0.0" // Commit represents the service git commit hash. // It's meant to be set using go build ldflags: // -ldflags "-X 'github.com/absmach/magistrala.Commit=ffffffff'". Commit = "ffffffff" // BuildTime represetns the service build time. // It's meant to be set using go build ldflags: // -ldflags "-X 'github.com/absmach/magistrala.BuildTime=1970-01-01_00:00:00'". BuildTime = "1970-01-01_00:00:00" )
var AuthService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "magistrala.AuthService", HandlerType: (*AuthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Authorize", Handler: _AuthService_Authorize_Handler, }, { MethodName: "Authenticate", Handler: _AuthService_Authenticate_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth.proto", }
AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var DomainsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "magistrala.DomainsService", HandlerType: (*DomainsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "DeleteUserFromDomains", Handler: _DomainsService_DeleteUserFromDomains_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth.proto", }
DomainsService_ServiceDesc is the grpc.ServiceDesc for DomainsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_auth_proto protoreflect.FileDescriptor
var ThingsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "magistrala.ThingsService", HandlerType: (*ThingsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Authorize", Handler: _ThingsService_Authorize_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth.proto", }
ThingsService_ServiceDesc is the grpc.ServiceDesc for ThingsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var TokenService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "magistrala.TokenService", HandlerType: (*TokenServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Issue", Handler: _TokenService_Issue_Handler, }, { MethodName: "Refresh", Handler: _TokenService_Refresh_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth.proto", }
TokenService_ServiceDesc is the grpc.ServiceDesc for TokenService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func Health ¶
func Health(service, instanceID string) http.HandlerFunc
Health exposes an HTTP handler for retrieving service health.
func RegisterAuthServiceServer ¶
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)
func RegisterDomainsServiceServer ¶ added in v0.15.0
func RegisterDomainsServiceServer(s grpc.ServiceRegistrar, srv DomainsServiceServer)
func RegisterThingsServiceServer ¶ added in v0.15.0
func RegisterThingsServiceServer(s grpc.ServiceRegistrar, srv ThingsServiceServer)
func RegisterTokenServiceServer ¶ added in v0.15.0
func RegisterTokenServiceServer(s grpc.ServiceRegistrar, srv TokenServiceServer)
Types ¶
type AuthNReq ¶ added in v0.15.0
type AuthNReq struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*AuthNReq) Descriptor
deprecated
added in
v0.15.0
func (*AuthNReq) ProtoMessage ¶ added in v0.15.0
func (*AuthNReq) ProtoMessage()
func (*AuthNReq) ProtoReflect ¶ added in v0.15.0
func (x *AuthNReq) ProtoReflect() protoreflect.Message
type AuthNRes ¶ added in v0.15.0
type AuthNRes struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // change "id" to "subject", sub in jwt = user + domain id UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // user id DomainId string `protobuf:"bytes,3,opt,name=domain_id,json=domainId,proto3" json:"domain_id,omitempty"` // domain id // contains filtered or unexported fields }
func (*AuthNRes) Descriptor
deprecated
added in
v0.15.0
func (*AuthNRes) GetDomainId ¶ added in v0.15.0
func (*AuthNRes) ProtoMessage ¶ added in v0.15.0
func (*AuthNRes) ProtoMessage()
func (*AuthNRes) ProtoReflect ¶ added in v0.15.0
func (x *AuthNRes) ProtoReflect() protoreflect.Message
type AuthServiceClient ¶
type AuthServiceClient interface { Authorize(ctx context.Context, in *AuthZReq, opts ...grpc.CallOption) (*AuthZRes, error) Authenticate(ctx context.Context, in *AuthNReq, opts ...grpc.CallOption) (*AuthNRes, error) }
AuthServiceClient is the client API for AuthService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
AuthService is a service that provides authentication and authorization functionalities for magistrala services.
func NewAuthServiceClient ¶
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient
type AuthServiceServer ¶
type AuthServiceServer interface { Authorize(context.Context, *AuthZReq) (*AuthZRes, error) Authenticate(context.Context, *AuthNReq) (*AuthNRes, error) // contains filtered or unexported methods }
AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility
AuthService is a service that provides authentication and authorization functionalities for magistrala services.
type AuthZReq ¶ added in v0.15.0
type AuthZReq struct { Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` // Domain SubjectType string `protobuf:"bytes,2,opt,name=subject_type,json=subjectType,proto3" json:"subject_type,omitempty"` // Thing or User SubjectKind string `protobuf:"bytes,3,opt,name=subject_kind,json=subjectKind,proto3" json:"subject_kind,omitempty"` // ID or Token SubjectRelation string `protobuf:"bytes,4,opt,name=subject_relation,json=subjectRelation,proto3" json:"subject_relation,omitempty"` // Subject relation Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // Subject value (id or token, depending on kind) Relation string `protobuf:"bytes,6,opt,name=relation,proto3" json:"relation,omitempty"` // Relation to filter Permission string `protobuf:"bytes,7,opt,name=permission,proto3" json:"permission,omitempty"` // Action Object string `protobuf:"bytes,8,opt,name=object,proto3" json:"object,omitempty"` // Object ID ObjectType string `protobuf:"bytes,9,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"` // Thing, User, Group // contains filtered or unexported fields }
func (*AuthZReq) Descriptor
deprecated
added in
v0.15.0
func (*AuthZReq) GetObjectType ¶ added in v0.15.0
func (*AuthZReq) GetPermission ¶ added in v0.15.0
func (*AuthZReq) GetRelation ¶ added in v0.15.0
func (*AuthZReq) GetSubject ¶ added in v0.15.0
func (*AuthZReq) GetSubjectKind ¶ added in v0.15.0
func (*AuthZReq) GetSubjectRelation ¶ added in v0.15.0
func (*AuthZReq) GetSubjectType ¶ added in v0.15.0
func (*AuthZReq) ProtoMessage ¶ added in v0.15.0
func (*AuthZReq) ProtoMessage()
func (*AuthZReq) ProtoReflect ¶ added in v0.15.0
func (x *AuthZReq) ProtoReflect() protoreflect.Message
type AuthZRes ¶ added in v0.15.0
type AuthZRes struct { Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*AuthZRes) Descriptor
deprecated
added in
v0.15.0
func (*AuthZRes) GetAuthorized ¶ added in v0.15.0
func (*AuthZRes) ProtoMessage ¶ added in v0.15.0
func (*AuthZRes) ProtoMessage()
func (*AuthZRes) ProtoReflect ¶ added in v0.15.0
func (x *AuthZRes) ProtoReflect() protoreflect.Message
type DeleteUserReq ¶ added in v0.15.0
type DeleteUserReq struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*DeleteUserReq) Descriptor
deprecated
added in
v0.15.0
func (*DeleteUserReq) Descriptor() ([]byte, []int)
Deprecated: Use DeleteUserReq.ProtoReflect.Descriptor instead.
func (*DeleteUserReq) GetId ¶ added in v0.15.0
func (x *DeleteUserReq) GetId() string
func (*DeleteUserReq) ProtoMessage ¶ added in v0.15.0
func (*DeleteUserReq) ProtoMessage()
func (*DeleteUserReq) ProtoReflect ¶ added in v0.15.0
func (x *DeleteUserReq) ProtoReflect() protoreflect.Message
func (*DeleteUserReq) Reset ¶ added in v0.15.0
func (x *DeleteUserReq) Reset()
func (*DeleteUserReq) String ¶ added in v0.15.0
func (x *DeleteUserReq) String() string
type DeleteUserRes ¶ added in v0.15.0
type DeleteUserRes struct { Deleted bool `protobuf:"varint,1,opt,name=deleted,proto3" json:"deleted,omitempty"` // contains filtered or unexported fields }
func (*DeleteUserRes) Descriptor
deprecated
added in
v0.15.0
func (*DeleteUserRes) Descriptor() ([]byte, []int)
Deprecated: Use DeleteUserRes.ProtoReflect.Descriptor instead.
func (*DeleteUserRes) GetDeleted ¶ added in v0.15.0
func (x *DeleteUserRes) GetDeleted() bool
func (*DeleteUserRes) ProtoMessage ¶ added in v0.15.0
func (*DeleteUserRes) ProtoMessage()
func (*DeleteUserRes) ProtoReflect ¶ added in v0.15.0
func (x *DeleteUserRes) ProtoReflect() protoreflect.Message
func (*DeleteUserRes) Reset ¶ added in v0.15.0
func (x *DeleteUserRes) Reset()
func (*DeleteUserRes) String ¶ added in v0.15.0
func (x *DeleteUserRes) String() string
type DomainsServiceClient ¶ added in v0.15.0
type DomainsServiceClient interface {
DeleteUserFromDomains(ctx context.Context, in *DeleteUserReq, opts ...grpc.CallOption) (*DeleteUserRes, error)
}
DomainsServiceClient is the client API for DomainsService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
DomainsService is a service that provides access to domains functionalities for magistrala services.
func NewDomainsServiceClient ¶ added in v0.15.0
func NewDomainsServiceClient(cc grpc.ClientConnInterface) DomainsServiceClient
type DomainsServiceServer ¶ added in v0.15.0
type DomainsServiceServer interface { DeleteUserFromDomains(context.Context, *DeleteUserReq) (*DeleteUserRes, error) // contains filtered or unexported methods }
DomainsServiceServer is the server API for DomainsService service. All implementations must embed UnimplementedDomainsServiceServer for forward compatibility
DomainsService is a service that provides access to domains functionalities for magistrala services.
type HealthInfo ¶
type HealthInfo struct { // Status contains service status. Status string `json:"status"` // Version contains current service version. Version string `json:"version"` // Commit represents the git hash commit. Commit string `json:"commit"` // Description contains service description. Description string `json:"description"` // BuildTime contains service build time. BuildTime string `json:"build_time"` // InstanceID contains the ID of the current service instance InstanceID string `json:"instance_id"` }
HealthInfo contains version endpoint response.
type IDProvider ¶
IDProvider specifies an API for generating unique identifiers.
type IssueReq ¶
type IssueReq struct { UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` Type uint32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*IssueReq) Descriptor
deprecated
func (*IssueReq) ProtoMessage ¶
func (*IssueReq) ProtoMessage()
func (*IssueReq) ProtoReflect ¶
func (x *IssueReq) ProtoReflect() protoreflect.Message
type RefreshReq ¶
type RefreshReq struct { RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` // contains filtered or unexported fields }
func (*RefreshReq) Descriptor
deprecated
func (*RefreshReq) Descriptor() ([]byte, []int)
Deprecated: Use RefreshReq.ProtoReflect.Descriptor instead.
func (*RefreshReq) GetRefreshToken ¶
func (x *RefreshReq) GetRefreshToken() string
func (*RefreshReq) ProtoMessage ¶
func (*RefreshReq) ProtoMessage()
func (*RefreshReq) ProtoReflect ¶
func (x *RefreshReq) ProtoReflect() protoreflect.Message
func (*RefreshReq) Reset ¶
func (x *RefreshReq) Reset()
func (*RefreshReq) String ¶
func (x *RefreshReq) String() string
type Response ¶
type Response interface { // Code returns HTTP response code. Code() int // Headers returns map of HTTP headers with their values. Headers() map[string]string // Empty indicates if HTTP response has content. Empty() bool }
Response contains HTTP response specific methods.
type ThingsAuthzReq ¶ added in v0.15.0
type ThingsAuthzReq struct { ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` ThingId string `protobuf:"bytes,2,opt,name=thing_id,json=thingId,proto3" json:"thing_id,omitempty"` ThingKey string `protobuf:"bytes,3,opt,name=thing_key,json=thingKey,proto3" json:"thing_key,omitempty"` Permission string `protobuf:"bytes,4,opt,name=permission,proto3" json:"permission,omitempty"` // contains filtered or unexported fields }
func (*ThingsAuthzReq) Descriptor
deprecated
added in
v0.15.0
func (*ThingsAuthzReq) Descriptor() ([]byte, []int)
Deprecated: Use ThingsAuthzReq.ProtoReflect.Descriptor instead.
func (*ThingsAuthzReq) GetChannelId ¶ added in v0.15.0
func (x *ThingsAuthzReq) GetChannelId() string
func (*ThingsAuthzReq) GetPermission ¶ added in v0.15.0
func (x *ThingsAuthzReq) GetPermission() string
func (*ThingsAuthzReq) GetThingId ¶ added in v0.15.0
func (x *ThingsAuthzReq) GetThingId() string
func (*ThingsAuthzReq) GetThingKey ¶ added in v0.15.0
func (x *ThingsAuthzReq) GetThingKey() string
func (*ThingsAuthzReq) ProtoMessage ¶ added in v0.15.0
func (*ThingsAuthzReq) ProtoMessage()
func (*ThingsAuthzReq) ProtoReflect ¶ added in v0.15.0
func (x *ThingsAuthzReq) ProtoReflect() protoreflect.Message
func (*ThingsAuthzReq) Reset ¶ added in v0.15.0
func (x *ThingsAuthzReq) Reset()
func (*ThingsAuthzReq) String ¶ added in v0.15.0
func (x *ThingsAuthzReq) String() string
type ThingsAuthzRes ¶ added in v0.15.0
type ThingsAuthzRes struct { Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ThingsAuthzRes) Descriptor
deprecated
added in
v0.15.0
func (*ThingsAuthzRes) Descriptor() ([]byte, []int)
Deprecated: Use ThingsAuthzRes.ProtoReflect.Descriptor instead.
func (*ThingsAuthzRes) GetAuthorized ¶ added in v0.15.0
func (x *ThingsAuthzRes) GetAuthorized() bool
func (*ThingsAuthzRes) GetId ¶ added in v0.15.0
func (x *ThingsAuthzRes) GetId() string
func (*ThingsAuthzRes) ProtoMessage ¶ added in v0.15.0
func (*ThingsAuthzRes) ProtoMessage()
func (*ThingsAuthzRes) ProtoReflect ¶ added in v0.15.0
func (x *ThingsAuthzRes) ProtoReflect() protoreflect.Message
func (*ThingsAuthzRes) Reset ¶ added in v0.15.0
func (x *ThingsAuthzRes) Reset()
func (*ThingsAuthzRes) String ¶ added in v0.15.0
func (x *ThingsAuthzRes) String() string
type ThingsServiceClient ¶ added in v0.15.0
type ThingsServiceClient interface { // Authorize checks if the thing is authorized to perform // the action on the channel. Authorize(ctx context.Context, in *ThingsAuthzReq, opts ...grpc.CallOption) (*ThingsAuthzRes, error) }
ThingsServiceClient is the client API for ThingsService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
ThingsService is a service that provides things authorization functionalities for magistrala services.
func NewThingsServiceClient ¶ added in v0.15.0
func NewThingsServiceClient(cc grpc.ClientConnInterface) ThingsServiceClient
type ThingsServiceServer ¶ added in v0.15.0
type ThingsServiceServer interface { // Authorize checks if the thing is authorized to perform // the action on the channel. Authorize(context.Context, *ThingsAuthzReq) (*ThingsAuthzRes, error) // contains filtered or unexported methods }
ThingsServiceServer is the server API for ThingsService service. All implementations must embed UnimplementedThingsServiceServer for forward compatibility
ThingsService is a service that provides things authorization functionalities for magistrala services.
type Token ¶
type Token struct { AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` RefreshToken *string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3,oneof" json:"refresh_token,omitempty"` AccessType string `protobuf:"bytes,3,opt,name=access_type,json=accessType,proto3" json:"access_type,omitempty"` // contains filtered or unexported fields }
If a token is not carrying any information itself, the type field can be used to determine how to validate the token. Also, different tokens can be encoded in different ways.
func (*Token) Descriptor
deprecated
func (*Token) GetAccessToken ¶
func (*Token) GetAccessType ¶
func (*Token) GetRefreshToken ¶
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶
func (x *Token) ProtoReflect() protoreflect.Message
type TokenServiceClient ¶ added in v0.15.0
type TokenServiceClient interface { Issue(ctx context.Context, in *IssueReq, opts ...grpc.CallOption) (*Token, error) Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*Token, error) }
TokenServiceClient is the client API for TokenService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewTokenServiceClient ¶ added in v0.15.0
func NewTokenServiceClient(cc grpc.ClientConnInterface) TokenServiceClient
type TokenServiceServer ¶ added in v0.15.0
type TokenServiceServer interface { Issue(context.Context, *IssueReq) (*Token, error) Refresh(context.Context, *RefreshReq) (*Token, error) // contains filtered or unexported methods }
TokenServiceServer is the server API for TokenService service. All implementations must embed UnimplementedTokenServiceServer for forward compatibility
type UnimplementedAuthServiceServer ¶
type UnimplementedAuthServiceServer struct { }
UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthServiceServer) Authenticate ¶ added in v0.15.0
type UnimplementedDomainsServiceServer ¶ added in v0.15.0
type UnimplementedDomainsServiceServer struct { }
UnimplementedDomainsServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedDomainsServiceServer) DeleteUserFromDomains ¶ added in v0.15.0
func (UnimplementedDomainsServiceServer) DeleteUserFromDomains(context.Context, *DeleteUserReq) (*DeleteUserRes, error)
type UnimplementedThingsServiceServer ¶ added in v0.15.0
type UnimplementedThingsServiceServer struct { }
UnimplementedThingsServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedThingsServiceServer) Authorize ¶ added in v0.15.0
func (UnimplementedThingsServiceServer) Authorize(context.Context, *ThingsAuthzReq) (*ThingsAuthzRes, error)
type UnimplementedTokenServiceServer ¶ added in v0.15.0
type UnimplementedTokenServiceServer struct { }
UnimplementedTokenServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedTokenServiceServer) Refresh ¶ added in v0.15.0
func (UnimplementedTokenServiceServer) Refresh(context.Context, *RefreshReq) (*Token, error)
type UnsafeAuthServiceServer ¶
type UnsafeAuthServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthServiceServer will result in compilation errors.
type UnsafeDomainsServiceServer ¶ added in v0.15.0
type UnsafeDomainsServiceServer interface {
// contains filtered or unexported methods
}
UnsafeDomainsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DomainsServiceServer will result in compilation errors.
type UnsafeThingsServiceServer ¶ added in v0.15.0
type UnsafeThingsServiceServer interface {
// contains filtered or unexported methods
}
UnsafeThingsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ThingsServiceServer will result in compilation errors.
type UnsafeTokenServiceServer ¶ added in v0.15.0
type UnsafeTokenServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTokenServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TokenServiceServer will result in compilation errors.
Directories
¶
Path | Synopsis |
---|---|
api
Package api contains implementation of Auth service HTTP API.
|
Package api contains implementation of Auth service HTTP API. |
api/grpc/auth
Package auth contains implementation of Auth service gRPC API.
|
Package auth contains implementation of Auth service gRPC API. |
api/grpc/domains
Package grpc contains implementation of Domains service gRPC API.
|
Package grpc contains implementation of Domains service gRPC API. |
api/grpc/token
Package grpc contains implementation of Auth service gRPC API.
|
Package grpc contains implementation of Auth service gRPC API. |
events
Package events provides the domain concept definitions needed to support Magistrala auth service functionality.
|
Package events provides the domain concept definitions needed to support Magistrala auth service functionality. |
postgres
Package postgres contains Key repository implementations using PostgreSQL as the underlying database.
|
Package postgres contains Key repository implementations using PostgreSQL as the underlying database. |
tracing
Package tracing provides tracing instrumentation for Magistrala Users service.
|
Package tracing provides tracing instrumentation for Magistrala Users service. |
Package bootstrap contains the domain concept definitions needed to support Magistrala bootstrap service functionality.
|
Package bootstrap contains the domain concept definitions needed to support Magistrala bootstrap service functionality. |
api
Package api contains implementation of bootstrap service HTTP API.
|
Package api contains implementation of bootstrap service HTTP API. |
events
Package events provides the domain concept definitions needed to support bootstrap events functionality.
|
Package events provides the domain concept definitions needed to support bootstrap events functionality. |
events/consumer
Package consumer contains events consumer for events published by Bootstrap service.
|
Package consumer contains events consumer for events published by Bootstrap service. |
events/producer
Package producer contains the domain events needed to support event sourcing of Bootstrap service actions.
|
Package producer contains the domain events needed to support event sourcing of Bootstrap service actions. |
mocks
Package mocks contains mocks for testing purposes.
|
Package mocks contains mocks for testing purposes. |
postgres
Package postgres contains repository implementations using PostgreSQL as the underlying database.
|
Package postgres contains repository implementations using PostgreSQL as the underlying database. |
tracing
Package tracing provides tracing instrumentation for Magistrala Users service.
|
Package tracing provides tracing instrumentation for Magistrala Users service. |
Package certs contains the domain concept definitions needed to support Magistrala certs service functionality.
|
Package certs contains the domain concept definitions needed to support Magistrala certs service functionality. |
api
Package api contains implementation of certs service HTTP API.
|
Package api contains implementation of certs service HTTP API. |
mocks
Package mocks contains mocks for testing purposes.
|
Package mocks contains mocks for testing purposes. |
pki/vault
Package pki contains the domain concept definitions needed to support Magistrala Certs service functionality.
|
Package pki contains the domain concept definitions needed to support Magistrala Certs service functionality. |
tracing
Package tracing provides tracing instrumentation for Magistrala Users Groups service.
|
Package tracing provides tracing instrumentation for Magistrala Users Groups service. |
Package cli contains the domain concept definitions needed to support Magistrala CLI functionality.
|
Package cli contains the domain concept definitions needed to support Magistrala CLI functionality. |
cmd
|
|
bootstrap
Package main contains bootstrap main function to start the bootstrap service.
|
Package main contains bootstrap main function to start the bootstrap service. |
certs
Package main contains certs main function to start the certs service.
|
Package main contains certs main function to start the certs service. |
cli
Package main contains cli main function to run the cli.
|
Package main contains cli main function to run the cli. |
coap
Package main contains coap-adapter main function to start the coap-adapter service.
|
Package main contains coap-adapter main function to start the coap-adapter service. |
http
Package main contains http-adapter main function to start the http-adapter service.
|
Package main contains http-adapter main function to start the http-adapter service. |
invitations
Package main contains invitations main function to start the invitations service.
|
Package main contains invitations main function to start the invitations service. |
journal
Package main contains journal main function to start the journal service.
|
Package main contains journal main function to start the journal service. |
mqtt
Package main contains mqtt-adapter main function to start the mqtt-adapter service.
|
Package main contains mqtt-adapter main function to start the mqtt-adapter service. |
postgres-reader
Package main contains postgres-reader main function to start the postgres-reader service.
|
Package main contains postgres-reader main function to start the postgres-reader service. |
postgres-writer
Package main contains postgres-writer main function to start the postgres-writer service.
|
Package main contains postgres-writer main function to start the postgres-writer service. |
provision
Package main contains provision main function to start the provision service.
|
Package main contains provision main function to start the provision service. |
things
Package main contains things main function to start the things service.
|
Package main contains things main function to start the things service. |
timescale-reader
Package main contains timescale-reader main function to start the timescale-reader service.
|
Package main contains timescale-reader main function to start the timescale-reader service. |
timescale-writer
Package main contains timescale-writer main function to start the timescale-writer service.
|
Package main contains timescale-writer main function to start the timescale-writer service. |
users
Package main contains users main function to start the users service.
|
Package main contains users main function to start the users service. |
ws
Package main contains websocket-adapter main function to start the websocket-adapter service.
|
Package main contains websocket-adapter main function to start the websocket-adapter service. |
Package coap contains the domain concept definitions needed to support Magistrala CoAP adapter service functionality.
|
Package coap contains the domain concept definitions needed to support Magistrala CoAP adapter service functionality. |
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
tracing
Package tracing provides tracing instrumentation for Magistrala WebSocket adapter service.
|
Package tracing provides tracing instrumentation for Magistrala WebSocket adapter service. |
Package consumers contain the domain concept definitions needed to support Magistrala consumer services functionality.
|
Package consumers contain the domain concept definitions needed to support Magistrala consumer services functionality. |
notifiers
Package notifiers contain the domain concept definitions needed to support Magistrala notifications functionality.
|
Package notifiers contain the domain concept definitions needed to support Magistrala notifications functionality. |
notifiers/api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
notifiers/mocks
Package mocks contains mocks for testing purposes.
|
Package mocks contains mocks for testing purposes. |
notifiers/postgres
Package postgres contains repository implementations using PostgreSQL as the underlying database.
|
Package postgres contains repository implementations using PostgreSQL as the underlying database. |
notifiers/tracing
Package tracing provides tracing instrumentation for Magistrala WebSocket adapter service.
|
Package tracing provides tracing instrumentation for Magistrala WebSocket adapter service. |
writers
Package writers contain the domain concept definitions needed to support Magistrala writer services functionality.
|
Package writers contain the domain concept definitions needed to support Magistrala writer services functionality. |
writers/api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
writers/postgres
Package postgres contains repository implementations using Postgres as the underlying database.
|
Package postgres contains repository implementations using Postgres as the underlying database. |
writers/timescale
Package timescale contains repository implementations using Timescale as the underlying database.
|
Package timescale contains repository implementations using Timescale as the underlying database. |
Package http contains the domain concept definitions needed to support Magistrala HTTP Adapter functionality.
|
Package http contains the domain concept definitions needed to support Magistrala HTTP Adapter functionality. |
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
internal
|
|
api
Package api contains commonly used constants and functions for the HTTP endpoints.
|
Package api contains commonly used constants and functions for the HTTP endpoints. |
clients
Package clients contains the domain concept definitions needed to support Magistrala clients functionality for example: postgres, redis, grpc, jaeger.
|
Package clients contains the domain concept definitions needed to support Magistrala clients functionality for example: postgres, redis, grpc, jaeger. |
clients/redis
Package redis contains the domain concept definitions needed to support Magistrala redis cache functionality.
|
Package redis contains the domain concept definitions needed to support Magistrala redis cache functionality. |
email
Package email contains the domain concept definitions needed to support Magistrala email functionality.
|
Package email contains the domain concept definitions needed to support Magistrala email functionality. |
groups/api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
groups/events
Package events contains event source Redis client implementation.
|
Package events contains event source Redis client implementation. |
groups/middleware
Package middleware provides middleware for Magistrala Groups service.
|
Package middleware provides middleware for Magistrala Groups service. |
groups/postgres
Package postgres contains the database implementation of groups repository layer.
|
Package postgres contains the database implementation of groups repository layer. |
groups/tracing
Package tracing provides tracing instrumentation for Magistrala Users Groups service.
|
Package tracing provides tracing instrumentation for Magistrala Users Groups service. |
Package invitations provides the API to manage invitations.
|
Package invitations provides the API to manage invitations. |
middleware
Package middleware contains the middleware for the invitations service.
|
Package middleware contains the middleware for the invitations service. |
mocks
Package mocks provides a mock implementation of the invitations repository.
|
Package mocks provides a mock implementation of the invitations repository. |
postgres
Package postgres provides a postgres implementation of the invitations repository.
|
Package postgres provides a postgres implementation of the invitations repository. |
Package journal contains the journal service.
|
Package journal contains the journal service. |
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
events
Package events provides the event consumer for the journal service.
|
Package events provides the event consumer for the journal service. |
middleware
Package middleware provides middleware for the journal service.
|
Package middleware provides middleware for the journal service. |
mocks
Package mocks contains mocks for testing purposes.
|
Package mocks contains mocks for testing purposes. |
postgres
Package postgres provides a postgres implementation of the journal log repository.
|
Package postgres provides a postgres implementation of the journal log repository. |
Package logger contains logger API definition, wrapper that can be used around any other logger.
|
Package logger contains logger API definition, wrapper that can be used around any other logger. |
Package mqtt contains the domain concept definitions needed to support Magistrala MQTT service functionality.
|
Package mqtt contains the domain concept definitions needed to support Magistrala MQTT service functionality. |
events
Package events provides the domain concept definitions needed to support mqtt events functionality.
|
Package events provides the domain concept definitions needed to support mqtt events functionality. |
mocks
Package mocks contains mocks for testing purposes.
|
Package mocks contains mocks for testing purposes. |
tracing
Package tracing provides tracing instrumentation for Magistrala MQTT adapter service.
|
Package tracing provides tracing instrumentation for Magistrala MQTT adapter service. |
Package pkg contains library packages used by Magistrala services and external services that integrate with Magistrala.
|
Package pkg contains library packages used by Magistrala services and external services that integrate with Magistrala. |
errors
Package errors contains Magistrala errors definitions.
|
Package errors contains Magistrala errors definitions. |
events/nats
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
|
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality. |
events/rabbitmq
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
|
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality. |
events/redis
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
|
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality. |
groups
Package groups contains the domain concept definitions needed to support Magistrala groups functionality.
|
Package groups contains the domain concept definitions needed to support Magistrala groups functionality. |
groups/mocks
Package mocks contains mocks for testing purposes.
|
Package mocks contains mocks for testing purposes. |
grpcclient
Package auth contains the domain concept definitions needed to support Magistrala auth functionality.
|
Package auth contains the domain concept definitions needed to support Magistrala auth functionality. |
jaeger
Package jaeger contains the domain concept definitions needed to support Magistrala Jaeger tracing functionality.
|
Package jaeger contains the domain concept definitions needed to support Magistrala Jaeger tracing functionality. |
messaging/mqtt
Package mqtt hold the implementation of the Publisher and PubSub interfaces for the MQTT messaging system, the internal messaging broker of the Magistrala IoT platform.
|
Package mqtt hold the implementation of the Publisher and PubSub interfaces for the MQTT messaging system, the internal messaging broker of the Magistrala IoT platform. |
messaging/nats
Package nats hold the implementation of the Publisher and PubSub interfaces for the NATS messaging system, the internal messaging broker of the Magistrala IoT platform.
|
Package nats hold the implementation of the Publisher and PubSub interfaces for the NATS messaging system, the internal messaging broker of the Magistrala IoT platform. |
messaging/nats/tracing
Package tracing provides tracing instrumentation for Magistrala things policies service.
|
Package tracing provides tracing instrumentation for Magistrala things policies service. |
messaging/rabbitmq
Package rabbitmq holds the implementation of the Publisher and PubSub interfaces for the RabbitMQ messaging system, the internal messaging broker of the Magistrala IoT platform.
|
Package rabbitmq holds the implementation of the Publisher and PubSub interfaces for the RabbitMQ messaging system, the internal messaging broker of the Magistrala IoT platform. |
messaging/rabbitmq/tracing
Package tracing provides tracing instrumentation for Magistrala things policies service.
|
Package tracing provides tracing instrumentation for Magistrala things policies service. |
messaging/tracing
Package tracing provides tracing instrumentation for Magistrala things policies service.
|
Package tracing provides tracing instrumentation for Magistrala things policies service. |
oauth2
Package oauth2 contains the domain concept definitions needed to support Magistrala ui service OAuth2 functionality.
|
Package oauth2 contains the domain concept definitions needed to support Magistrala ui service OAuth2 functionality. |
oauth2/google
Package google contains the domain concept definitions needed to support Magistrala services for Google OAuth2 functionality.
|
Package google contains the domain concept definitions needed to support Magistrala services for Google OAuth2 functionality. |
policies
Package policies contains Magistrala policy definitions.
|
Package policies contains Magistrala policy definitions. |
policies/spicedb
Package server contains the HTTP, gRPC and CoAP server implementation.
|
Package server contains the HTTP, gRPC and CoAP server implementation. |
postgres
Package postgres contains the domain concept definitions needed to support Magistrala PostgreSQL database functionality.
|
Package postgres contains the domain concept definitions needed to support Magistrala PostgreSQL database functionality. |
prometheus
Package prometheus provides a framework for defining and collecting metrics for prometheus.
|
Package prometheus provides a framework for defining and collecting metrics for prometheus. |
sdk/go
Package sdk contains Magistrala SDK.
|
Package sdk contains Magistrala SDK. |
server
Package server contains the HTTP, gRPC and CoAP server implementation.
|
Package server contains the HTTP, gRPC and CoAP server implementation. |
server/coap
Package coap contains the CoAP server implementation.
|
Package coap contains the CoAP server implementation. |
server/grpc
Package grpc contains the gRPC server implementation.
|
Package grpc contains the gRPC server implementation. |
server/http
Package http contains the HTTP server implementation.
|
Package http contains the HTTP server implementation. |
transformers
Package transformers contains the domain concept definitions needed to support Magistrala transformer services functionality.
|
Package transformers contains the domain concept definitions needed to support Magistrala transformer services functionality. |
transformers/json
Package json contains JSON transformer.
|
Package json contains JSON transformer. |
transformers/senml
Package senml contains SenML transformer.
|
Package senml contains SenML transformer. |
ulid
Package ulid contains ULID generator.
|
Package ulid contains ULID generator. |
uuid
Package uuid contains UUID generator.
|
Package uuid contains UUID generator. |
Package provision contains domain concept definitions needed to support Provision service feature, i.e.
|
Package provision contains domain concept definitions needed to support Provision service feature, i.e. |
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
Package readers provides a set of readers for various formats.
|
Package readers provides a set of readers for various formats. |
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
mocks
Package mocks contains mocks for testing purposes.
|
Package mocks contains mocks for testing purposes. |
postgres
Package postgres contains repository implementations using Postgres as the underlying database.
|
Package postgres contains repository implementations using Postgres as the underlying database. |
timescale
Package timescale contains repository implementations using Timescale as the underlying database.
|
Package timescale contains repository implementations using Timescale as the underlying database. |
Package things contains the domain concept definitions needed to support Magistrala things service functionality.
|
Package things contains the domain concept definitions needed to support Magistrala things service functionality. |
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
api/grpc
Package grpc contains implementation of Auth service gRPC API.
|
Package grpc contains implementation of Auth service gRPC API. |
cache
Package cache contains the domain concept definitions needed to support Magistrala things cache service functionality.
|
Package cache contains the domain concept definitions needed to support Magistrala things cache service functionality. |
events
Package events provides the domain concept definitions needed to support things clients events functionality.
|
Package events provides the domain concept definitions needed to support things clients events functionality. |
middleware
Package middleware provides middleware for Magistrala Things service.
|
Package middleware provides middleware for Magistrala Things service. |
mocks
Package mocks contains mocks for testing purposes.
|
Package mocks contains mocks for testing purposes. |
postgres
Package postgres contains the database implementation of clients repository layer.
|
Package postgres contains the database implementation of clients repository layer. |
standalone
Package standalone contains implementation for auth service in single-user scenario.
|
Package standalone contains implementation for auth service in single-user scenario. |
tracing
Package tracing provides tracing instrumentation for Magistrala things clients service.
|
Package tracing provides tracing instrumentation for Magistrala things clients service. |
Package tools contains tools for Magistrala.
|
Package tools contains tools for Magistrala. |
e2e
Package e2e contains entry point for end-to-end tests.
|
Package e2e contains entry point for end-to-end tests. |
e2e/cmd
Package main contains e2e tool for testing Magistrala.
|
Package main contains e2e tool for testing Magistrala. |
mqtt-bench
Package bench contains benchmarking tool for MQTT broker.
|
Package bench contains benchmarking tool for MQTT broker. |
mqtt-bench/cmd
Package main contains the entry point of the mqtt-bench tool.
|
Package main contains the entry point of the mqtt-bench tool. |
provision
Package provision is a simple utility to create a list of channels and things connected to these channels with possibility to create certificates for mTLS use case.
|
Package provision is a simple utility to create a list of channels and things connected to these channels with possibility to create certificates for mTLS use case. |
provision/cmd
Package main contains entry point for provisioning tool.
|
Package main contains entry point for provisioning tool. |
Package users contains the domain concept definitions needed to support Magistrala users service functionality.
|
Package users contains the domain concept definitions needed to support Magistrala users service functionality. |
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
emailer
Package emailer contains the domain concept definitions needed to support Magistrala users email service functionality.
|
Package emailer contains the domain concept definitions needed to support Magistrala users email service functionality. |
events
Package events provides the domain concept definitions needed to support Magistrala users service functionality.
|
Package events provides the domain concept definitions needed to support Magistrala users service functionality. |
hasher
Package hasher contains the domain concept definitions needed to support Magistrala users password hasher sub-service functionality.
|
Package hasher contains the domain concept definitions needed to support Magistrala users password hasher sub-service functionality. |
middleware
Package middleware provides middleware for Magistrala Users service.
|
Package middleware provides middleware for Magistrala Users service. |
mocks
Package mocks contains mocks for testing purposes.
|
Package mocks contains mocks for testing purposes. |
postgres
Package postgres contains the database implementation of users repository layer.
|
Package postgres contains the database implementation of users repository layer. |
tracing
Package tracing provides tracing instrumentation for Magistrala Users service.
|
Package tracing provides tracing instrumentation for Magistrala Users service. |
Package ws provides domain concept definitions required to support Magistrala WebSocket adapter service functionality.
|
Package ws provides domain concept definitions required to support Magistrala WebSocket adapter service functionality. |
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
tracing
Package tracing provides tracing instrumentation for Magistrala WebSocket adapter service.
|
Package tracing provides tracing instrumentation for Magistrala WebSocket adapter service. |