Documentation ¶
Index ¶
- Variables
- func NewHTTPOverUDSClient(socketAddr string, opts ...ClientOption) (*http.Client, error)
- type AdminService
- type AppNames
- type CLI
- type CLIError
- type Client
- type ClientOption
- type Controller
- type DeleteAppInput
- type HTTPClient
- type HTTPServer
- type Server
- type Storage
- 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 AdminService ¶
type AdminService struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(v Storage) *AdminService
func (*AdminService) DeleteApp ¶
func (m *AdminService) DeleteApp(appname string) error
func (*AdminService) GetApps ¶
func (m *AdminService) GetApps() (appNames []string)
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
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) 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, adminService *AdminService, userService UserService) *Controller
func (*Controller) HandleDeleteApp ¶
func (ctrl *Controller) HandleDeleteApp(w http.ResponseWriter, r *http.Request)
HandleDeleteApp handles DELETE requests
func (*Controller) HandleGetApps ¶
func (ctrl *Controller) HandleGetApps(w http.ResponseWriter, _ *http.Request)
HandleGetApps handles GET requests
func (*Controller) UpdateUserHandler ¶ added in v0.10.0
func (ctrl *Controller) UpdateUserHandler(w http.ResponseWriter, r *http.Request)
type DeleteAppInput ¶
type DeleteAppInput struct {
Name string `json:"name"`
}
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 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.