api

package
v0.37.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const JWTCookieName = "pyroscopeJWT"

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(loginRedirect http.HandlerFunc, authService AuthService, h httputils.Utils) func(next http.Handler) http.Handler

AuthMiddleware authenticates requests.

Types

type APIKeyHandler

type APIKeyHandler struct {
	// contains filtered or unexported fields
}

func NewAPIKeyHandler

func NewAPIKeyHandler(logger logrus.FieldLogger, apiKeyService APIKeyService, httpUtils httputils.Utils) APIKeyHandler

func (APIKeyHandler) CreateAPIKey

func (h APIKeyHandler) CreateAPIKey(w http.ResponseWriter, r *http.Request)

func (APIKeyHandler) DeleteAPIKey

func (h APIKeyHandler) DeleteAPIKey(w http.ResponseWriter, r *http.Request)

func (APIKeyHandler) ListAPIKeys

func (h APIKeyHandler) ListAPIKeys(w http.ResponseWriter, r *http.Request)

type APIKeyService

type APIKeyService interface {
	CreateAPIKey(context.Context, model.CreateAPIKeyParams) (model.APIKey, string, error)
	GetAllAPIKeys(context.Context) ([]model.APIKey, error)
	DeleteAPIKeyByID(context.Context, uint) error
}

type AdhocHandler added in v0.30.0

type AdhocHandler struct {
	// contains filtered or unexported fields
}

func NewAdhocHandler added in v0.30.0

func NewAdhocHandler(adhocService AdhocService, httpUtils httputils.Utils) AdhocHandler

func (AdhocHandler) GetProfile added in v0.30.0

func (h AdhocHandler) GetProfile(w http.ResponseWriter, r *http.Request)

func (AdhocHandler) GetProfileDiff added in v0.30.0

func (h AdhocHandler) GetProfileDiff(w http.ResponseWriter, r *http.Request)

func (AdhocHandler) GetProfiles added in v0.30.0

func (h AdhocHandler) GetProfiles(w http.ResponseWriter, r *http.Request)

func (AdhocHandler) Upload added in v0.30.0

func (h AdhocHandler) Upload(w http.ResponseWriter, r *http.Request)

type AdhocService added in v0.30.0

type AdhocService interface {
	// GetProfileByID retrieves profile with the given ID.
	GetProfileByID(ctx context.Context, id string) (*flamebearer.FlamebearerProfile, error)
	// GetAllProfiles lists all the known profiles.
	GetAllProfiles(context.Context) ([]model.AdhocProfile, error)
	// GetProfileDiffByID retrieves two profiles identified by their IDs and builds the profile diff.
	GetProfileDiffByID(context.Context, model.GetAdhocProfileDiffByIDParams) (*flamebearer.FlamebearerProfile, error)
	// UploadProfile stores the profile provided and returns the entity created.
	UploadProfile(context.Context, model.UploadAdhocProfileParams) (p *flamebearer.FlamebearerProfile, id string, err error)
}

type AnnotationsHandler added in v0.29.0

type AnnotationsHandler struct {
	// contains filtered or unexported fields
}

func NewAnnotationsHandler added in v0.29.0

func NewAnnotationsHandler(svc AnnotationsService, httpUtils httputils.Utils) *AnnotationsHandler

func (*AnnotationsHandler) CreateAnnotation added in v0.29.0

func (h *AnnotationsHandler) CreateAnnotation(w http.ResponseWriter, r *http.Request)

type AnnotationsService added in v0.29.0

type AnnotationsService interface {
	CreateAnnotation(ctx context.Context, params model.CreateAnnotation) (*model.Annotation, error)
	FindAnnotationsByTimeRange(ctx context.Context, appName string, startTime time.Time, endTime time.Time) ([]model.Annotation, error)
}

type ApplicationListerAndDeleter added in v0.34.1

type ApplicationListerAndDeleter interface {
	List(context.Context) ([]appmetadata.ApplicationMetadata, error)
	Delete(ctx context.Context, name string) error
}

type ApplicationsHandler added in v0.34.1

type ApplicationsHandler struct {
	// contains filtered or unexported fields
}

func NewApplicationsHandler added in v0.34.1

func NewApplicationsHandler(svc ApplicationListerAndDeleter, httpUtils httputils.Utils) *ApplicationsHandler

func (*ApplicationsHandler) DeleteApp added in v0.34.1

func (h *ApplicationsHandler) DeleteApp(w http.ResponseWriter, r *http.Request)

func (*ApplicationsHandler) GetApps added in v0.34.1

type AuthService

type AuthService interface {
	APIKeyFromToken(ctx context.Context, token string) (model.APIKey, error)
	UserFromJWTToken(ctx context.Context, token string) (model.User, error)
	AuthenticateUser(ctx context.Context, name, password string) (model.User, error)
}

type CreateParams added in v0.29.0

type CreateParams struct {
	AppName   string   `json:"appName"`
	AppNames  []string `json:"appNames"`
	Timestamp int64    `json:"timestamp"`
	Content   string   `json:"content"`
}

type DeleteAppInput added in v0.34.1

type DeleteAppInput struct {
	Name string `json:"name"`
}

type UserHandler

type UserHandler struct {
	// contains filtered or unexported fields
}

func NewUserHandler

func NewUserHandler(userService UserService, httpUtils httputils.Utils) UserHandler

func (UserHandler) ChangeAuthenticatedUserPassword

func (h UserHandler) ChangeAuthenticatedUserPassword(w http.ResponseWriter, r *http.Request)

func (UserHandler) ChangeUserPassword

func (h UserHandler) ChangeUserPassword(w http.ResponseWriter, r *http.Request)

func (UserHandler) ChangeUserRole

func (h UserHandler) ChangeUserRole(w http.ResponseWriter, r *http.Request)

func (UserHandler) CreateUser

func (h UserHandler) CreateUser(w http.ResponseWriter, r *http.Request)

func (UserHandler) DeleteUser

func (h UserHandler) DeleteUser(w http.ResponseWriter, r *http.Request)

func (UserHandler) DisableUser

func (h UserHandler) DisableUser(w http.ResponseWriter, r *http.Request)

func (UserHandler) EnableUser

func (h UserHandler) EnableUser(w http.ResponseWriter, r *http.Request)

func (UserHandler) GetAuthenticatedUser

func (h UserHandler) GetAuthenticatedUser(w http.ResponseWriter, r *http.Request)

func (UserHandler) GetUser

func (h UserHandler) GetUser(w http.ResponseWriter, r *http.Request)

func (UserHandler) ListUsers

func (h UserHandler) ListUsers(w http.ResponseWriter, r *http.Request)

func (UserHandler) UpdateAuthenticatedUser

func (h UserHandler) UpdateAuthenticatedUser(w http.ResponseWriter, r *http.Request)

func (UserHandler) UpdateUser

func (h UserHandler) UpdateUser(w http.ResponseWriter, r *http.Request)

type UserService

type UserService interface {
	CreateUser(context.Context, model.CreateUserParams) (model.User, error)
	FindUserByID(context.Context, uint) (model.User, error)
	GetAllUsers(context.Context) ([]model.User, error)
	UpdateUserByID(context.Context, uint, model.UpdateUserParams) (model.User, error)
	UpdateUserPasswordByID(context.Context, uint, model.UpdateUserPasswordParams) error
	DeleteUserByID(context.Context, uint) error
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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