Documentation ¶
Index ¶
- Variables
- func NewHTTPOverUDSClient(socketAddr string, opts ...ClientOption) (*http.Client, error)
- type AppNames
- type ApplicationListerAndDeleter
- type CLI
- type CLIError
- type Client
- type ClientOption
- type Controller
- type HTTPClient
- type HTTPServer
- type Server
- type StorageService
- type UdsHTTPServer
- type UpdateUserRequest
- type UserService
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHTTPClientCreation = errors.New("failed to create http over uds client") ErrMakingRequest = errors.New("failed to make a request") ErrStatusCodeNotOK = errors.New("failed to get a response with a valid status code") ErrDecodingResponse = errors.New("error while decoding a (assumed) json response") ErrMarshalingPayload = errors.New("error while marshalling the payload") )
View Source
var ( // ErrSocketStillResponding refers to when // a) an instance of the server is still running normally; or // b) server was not closed properly ErrSocketStillResponding = errors.New("a server is still running and responding to socket") // ErrInvalidSocketPathname refers to when the socket filepath is obviously invalid (eg empty string) ErrInvalidSocketPathname = errors.New("the socket filepath is invalid") // ErrListenerBind refers to generic errors ErrListenerBind = errors.New("could not listen on socket") // Anything works here SocketHTTPAddress = "http://pyroscope" HealthAddress = SocketHTTPAddress + "/health" )
Functions ¶
func NewHTTPOverUDSClient ¶
func NewHTTPOverUDSClient(socketAddr string, opts ...ClientOption) (*http.Client, error)
NewHTTPOverUDSClient creates a http client that communicates via UDS (unix domain sockets)
Types ¶
type ApplicationListerAndDeleter ¶ added in v0.34.1
type ApplicationListerAndDeleter interface { List(ctx context.Context) (apps []appmetadata.ApplicationMetadata, err error) Delete(ctx context.Context, name string) error }
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
func (*CLI) CleanupStorage ¶ added in v0.12.0
func (*CLI) CompleteApp ¶
CompleteApp returns the list of apps it's meant for cobra's autocompletion TODO use the parameter for fuzzy search?
func (*CLI) GetAppsNames ¶
GetAppsNames returns the list of all apps
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CleanupStorage ¶ added in v0.12.0
func (*Client) GetAppsNames ¶
type ClientOption ¶
func WithTimeout ¶
func WithTimeout(d time.Duration) ClientOption
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController( log *logrus.Logger, appService ApplicationListerAndDeleter, userService UserService, storageService StorageService) *Controller
func (*Controller) StorageCleanupHandler ¶ added in v0.12.0
func (ctrl *Controller) StorageCleanupHandler(w http.ResponseWriter, r *http.Request)
func (*Controller) UpdateUserHandler ¶ added in v0.10.0
func (ctrl *Controller) UpdateUserHandler(w http.ResponseWriter, r *http.Request)
type Server ¶
type Server struct { Handler http.Handler HTTPServer // contains filtered or unexported fields }
func NewServer ¶
func NewServer(logger *logrus.Logger, ctrl *Controller, httpServer HTTPServer) (*Server, error)
NewServer creates an AdminServer and returns an error Is also does basic verifications: - Checks if the SocketAddress is non empty
type StorageService ¶ added in v0.12.0
type UdsHTTPServer ¶
type UdsHTTPServer struct {
// contains filtered or unexported fields
}
func NewUdsHTTPServer ¶
func NewUdsHTTPServer(socketAddr string, httpClient HTTPClient) (*UdsHTTPServer, error)
NewUdsHTTPServer creates a http server that responds over UDS (unix domain socket)
func (*UdsHTTPServer) Stop ¶
func (u *UdsHTTPServer) Stop() error
type UpdateUserRequest ¶ added in v0.10.0
type UpdateUserRequest struct { Password *string `json:"password"` IsDisabled *bool `json:"isDisabled"` }
func (*UpdateUserRequest) SetIsDisabled ¶ added in v0.10.0
func (r *UpdateUserRequest) SetIsDisabled(v bool)
type UserService ¶ added in v0.10.0
Click to show internal directories.
Click to hide internal directories.