Documentation ¶
Index ¶
- type APIKeyService
- func (svc APIKeyService) CreateAPIKey(ctx context.Context, params model.CreateAPIKeyParams) (model.APIKey, string, error)
- func (svc APIKeyService) DeleteAPIKeyByID(ctx context.Context, id uint) error
- func (svc APIKeyService) FindAPIKeyByID(ctx context.Context, id uint) (model.APIKey, error)
- func (svc APIKeyService) FindAPIKeyByName(ctx context.Context, name string) (model.APIKey, error)
- func (svc APIKeyService) GetAllAPIKeys(ctx context.Context) ([]model.APIKey, error)
- type AdhocService
- func (svc *AdhocService) GetAllProfiles(_ context.Context) ([]model.AdhocProfile, error)
- func (svc *AdhocService) GetProfileByID(_ context.Context, id string) (*flamebearer.FlamebearerProfile, error)
- func (svc *AdhocService) GetProfileDiffByID(_ context.Context, params model.GetAdhocProfileDiffByIDParams) (*flamebearer.FlamebearerProfile, error)
- func (svc *AdhocService) UploadProfile(_ context.Context, params model.UploadAdhocProfileParams) (*flamebearer.FlamebearerProfile, string, error)
- type AnnotationsService
- type AppDeleter
- type ApplicationMetadataCacheService
- type ApplicationMetadataCacheServiceConfig
- type ApplicationMetadataService
- func (svc ApplicationMetadataService) CreateOrUpdate(ctx context.Context, application appmetadata.ApplicationMetadata) error
- func (svc ApplicationMetadataService) Delete(ctx context.Context, name string) error
- func (svc ApplicationMetadataService) Get(ctx context.Context, name string) (appmetadata.ApplicationMetadata, error)
- func (svc ApplicationMetadataService) List(ctx context.Context) (apps []appmetadata.ApplicationMetadata, err error)
- type ApplicationMetadataWriter
- type ApplicationService
- type AuthService
- type CachingAuthService
- type CachingAuthServiceConfig
- type JWTTokenService
- type UserService
- func (svc UserService) CreateUser(ctx context.Context, params model.CreateUserParams) (model.User, error)
- func (svc UserService) DeleteUserByID(ctx context.Context, id uint) error
- func (svc UserService) FindUserByEmail(ctx context.Context, email string) (model.User, error)
- func (svc UserService) FindUserByID(ctx context.Context, id uint) (model.User, error)
- func (svc UserService) FindUserByName(ctx context.Context, name string) (model.User, error)
- func (svc UserService) GetAllUsers(ctx context.Context) ([]model.User, error)
- func (svc UserService) UpdateUserByID(ctx context.Context, id uint, params model.UpdateUserParams) (model.User, error)
- func (svc UserService) UpdateUserByName(ctx context.Context, name string, params model.UpdateUserParams) (model.User, error)
- func (svc UserService) UpdateUserPasswordByID(ctx context.Context, id uint, params model.UpdateUserPasswordParams) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyService ¶
type APIKeyService struct {
// contains filtered or unexported fields
}
func NewAPIKeyService ¶
func NewAPIKeyService(db *gorm.DB) APIKeyService
func (APIKeyService) CreateAPIKey ¶
func (svc APIKeyService) CreateAPIKey(ctx context.Context, params model.CreateAPIKeyParams) (model.APIKey, string, error)
func (APIKeyService) DeleteAPIKeyByID ¶
func (svc APIKeyService) DeleteAPIKeyByID(ctx context.Context, id uint) error
func (APIKeyService) FindAPIKeyByID ¶
func (APIKeyService) FindAPIKeyByName ¶
func (APIKeyService) GetAllAPIKeys ¶
type AdhocService ¶ added in v0.30.0
type AdhocService struct {
// contains filtered or unexported fields
}
func NewAdhocService ¶ added in v0.30.0
func NewAdhocService(maxNodes int, dataDir string) *AdhocService
func (*AdhocService) GetAllProfiles ¶ added in v0.30.0
func (svc *AdhocService) GetAllProfiles(_ context.Context) ([]model.AdhocProfile, error)
GetAllProfiles retrieves the list of profiles for the local pyroscope data directory. The profiles are assigned a unique ID (hash based) which is then used for retrieval. This requires a bit of extra work to setup the IDs but prevents the clients from accesing the filesystem directly, removing that whole attack vector.
The profiles are retrieved every time the endpoint is requested, which should be good enough as massive access to this auth endpoint is not expected.
func (*AdhocService) GetProfileByID ¶ added in v0.30.0
func (svc *AdhocService) GetProfileByID(_ context.Context, id string) (*flamebearer.FlamebearerProfile, error)
func (*AdhocService) GetProfileDiffByID ¶ added in v0.30.0
func (svc *AdhocService) GetProfileDiffByID(_ context.Context, params model.GetAdhocProfileDiffByIDParams) (*flamebearer.FlamebearerProfile, error)
func (*AdhocService) UploadProfile ¶ added in v0.30.0
func (svc *AdhocService) UploadProfile(_ context.Context, params model.UploadAdhocProfileParams) (*flamebearer.FlamebearerProfile, string, error)
type AnnotationsService ¶ added in v0.29.0
type AnnotationsService struct {
// contains filtered or unexported fields
}
func NewAnnotationsService ¶ added in v0.29.0
func NewAnnotationsService(db *gorm.DB) AnnotationsService
func (AnnotationsService) CreateAnnotation ¶ added in v0.29.0
func (svc AnnotationsService) CreateAnnotation(ctx context.Context, params model.CreateAnnotation) (*model.Annotation, error)
CreateAnnotation creates a single annotation for a given application It does not check if the application has consumed any data
func (AnnotationsService) FindAnnotationsByTimeRange ¶ added in v0.29.0
func (svc AnnotationsService) FindAnnotationsByTimeRange(ctx context.Context, appName string, startTime time.Time, endTime time.Time) ([]model.Annotation, error)
FindAnnotationsByTimeRange finds all annotations for an app in a time range
type AppDeleter ¶ added in v0.34.1
type ApplicationMetadataCacheService ¶ added in v0.34.0
type ApplicationMetadataCacheService struct {
// contains filtered or unexported fields
}
func NewApplicationMetadataCacheService ¶ added in v0.34.0
func NewApplicationMetadataCacheService(config ApplicationMetadataCacheServiceConfig, appSvc ApplicationMetadataWriter) *ApplicationMetadataCacheService
func (*ApplicationMetadataCacheService) CreateOrUpdate ¶ added in v0.34.0
func (svc *ApplicationMetadataCacheService) CreateOrUpdate(ctx context.Context, application appmetadata.ApplicationMetadata) error
CreateOrUpdate delegates to the underlying service in the following cases: * item is not in the cache * data is different from what's in the cache Otherwise it does nothing
type ApplicationMetadataCacheServiceConfig ¶ added in v0.34.0
type ApplicationMetadataService ¶ added in v0.34.0
type ApplicationMetadataService struct {
// contains filtered or unexported fields
}
func NewApplicationMetadataService ¶ added in v0.34.0
func NewApplicationMetadataService(db *gorm.DB) ApplicationMetadataService
func (ApplicationMetadataService) CreateOrUpdate ¶ added in v0.34.0
func (svc ApplicationMetadataService) CreateOrUpdate(ctx context.Context, application appmetadata.ApplicationMetadata) error
func (ApplicationMetadataService) Delete ¶ added in v0.34.0
func (svc ApplicationMetadataService) Delete(ctx context.Context, name string) error
func (ApplicationMetadataService) Get ¶ added in v0.34.0
func (svc ApplicationMetadataService) Get(ctx context.Context, name string) (appmetadata.ApplicationMetadata, error)
func (ApplicationMetadataService) List ¶ added in v0.34.0
func (svc ApplicationMetadataService) List(ctx context.Context) (apps []appmetadata.ApplicationMetadata, err error)
type ApplicationMetadataWriter ¶ added in v0.34.0
type ApplicationMetadataWriter interface {
CreateOrUpdate(ctx context.Context, application appmetadata.ApplicationMetadata) error
}
type ApplicationService ¶ added in v0.34.1
type ApplicationService struct { ApplicationMetadataService // contains filtered or unexported fields }
func NewApplicationService ¶ added in v0.34.1
func NewApplicationService(appMetadataSvc ApplicationMetadataService, storageDeleter AppDeleter) ApplicationService
NewApplicationService creates an ApplicationService Which just delegates to its underlying ApplicationMetadataService Except when deleting, which is then forward to both ApplicationMetadataService and storageDeleter
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(db *gorm.DB, jwtTokenService JWTTokenService) AuthService
func (AuthService) APIKeyFromToken ¶
func (AuthService) AuthenticateUser ¶
func (svc AuthService) AuthenticateUser(ctx context.Context, name string, password string) (model.User, error)
AuthenticateUser returns User with the given login if its password hash matches the given one. If user cannot be found or the password does not match the function returns ErrCredentialsInvalid.
External users are not allowed to use password authentication. TODO(kolesnikovae): It's true for "some" authentication providers. Others may need us to pass through the credentials (e.g. LDAP).
func (AuthService) UserFromJWTToken ¶
type CachingAuthService ¶
type CachingAuthService struct { AuthService // contains filtered or unexported fields }
func NewCachingAuthService ¶
func NewCachingAuthService(authService AuthService, c CachingAuthServiceConfig) CachingAuthService
func (CachingAuthService) APIKeyFromToken ¶
func (CachingAuthService) DeleteAPIKey ¶
func (svc CachingAuthService) DeleteAPIKey(t string)
type JWTTokenService ¶
type JWTTokenService struct {
// contains filtered or unexported fields
}
func NewJWTTokenService ¶
func NewJWTTokenService(signingKey []byte, tokenTTL time.Duration) JWTTokenService
func (JWTTokenService) GenerateUserJWTToken ¶
func (JWTTokenService) Parse ¶
func (svc JWTTokenService) Parse(t string) (*jwt.Token, error)
Parse parses the token and validates it using the signing key.
func (JWTTokenService) UserFromJWTToken ¶
UserFromJWTToken retrieves user info from the given JWT token. 'name' claim must be present and valid, otherwise the function returns false. The function does not validate the token.
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(db *gorm.DB) UserService
func (UserService) CreateUser ¶
func (svc UserService) CreateUser(ctx context.Context, params model.CreateUserParams) (model.User, error)
func (UserService) DeleteUserByID ¶
func (svc UserService) DeleteUserByID(ctx context.Context, id uint) error
func (UserService) FindUserByEmail ¶
func (UserService) FindUserByID ¶
func (UserService) FindUserByName ¶
func (UserService) GetAllUsers ¶
func (UserService) UpdateUserByID ¶
func (svc UserService) UpdateUserByID(ctx context.Context, id uint, params model.UpdateUserParams) (model.User, error)
func (UserService) UpdateUserByName ¶
func (svc UserService) UpdateUserByName(ctx context.Context, name string, params model.UpdateUserParams) (model.User, error)
func (UserService) UpdateUserPasswordByID ¶
func (svc UserService) UpdateUserPasswordByID(ctx context.Context, id uint, params model.UpdateUserPasswordParams) error