Documentation
¶
Overview ¶
Package api Hanzo Space Console Server
Schemes: http ws Host: localhost BasePath: /api/v1 Version: 0.1.0 Consumes: - application/json - multipart/form-data Produces: - application/octet-stream - application/json
swagger:meta
Index ¶
- Constants
- Variables
- func AuditLogMiddleware(next http.Handler) http.Handler
- func AuthenticationMiddleware(next http.Handler) http.Handler
- func ContextMiddleware(next http.Handler) http.Handler
- func DebugLogMiddleware(next http.Handler) http.Handler
- func DifferenceArrays(a, b []string) []string
- func ExpireSessionCookie() http.Cookie
- func FileServerMiddleware(next http.Handler) http.Handler
- func GetConsoleHTTPClient(clientIP string) *http.Client
- func GetHostname() string
- func GetPort() int
- func GetS3Region() string
- func GetSecureAllowedHosts() []string
- func GetSecureAllowedHostsAreRegex() bool
- func GetSecureBrowserXSSFilter() bool
- func GetSecureContentSecurityPolicy() string
- func GetSecureContentSecurityPolicyReportOnly() string
- func GetSecureContentTypeNonSniff() bool
- func GetSecureFeaturePolicy() string
- func GetSecureForceSTSHeader() bool
- func GetSecureFrameDeny() bool
- func GetSecureHostsProxyHeaders() []string
- func GetSecureReferrerPolicy() string
- func GetSecureSTSIncludeSubdomains() bool
- func GetSecureSTSPreload() bool
- func GetSecureSTSSeconds() int64
- func GetSecureTLSHost() string
- func GetTLSPort() int
- func GetTLSRedirect() string
- func IsElementInArray(a []string, b string) bool
- func NewConsoleCredentials(accessKey, secretKey, location string, client *http.Client) (*credentials.Credentials, error)
- func NewS3AdminClient(ctx context.Context, sessionClaims *models.Principal) (*madmin.AdminClient, error)
- func NewSessionCookieForConsole(token string) http.Cookie
- func PrepareConsoleHTTPClient(clientIP string) *http.Client
- func RandomCharString(n int) string
- func RandomCharStringWithAlphabet(n int, alphabet string) string
- func RejectS3Middleware(next http.Handler) http.Handler
- func UniqueKeys(a []string) []string
- func ValidateEncodedStyles(encodedStyles string) error
- type AdminClient
- type AdminClientMock
- type CodedAPIError
- type Conditions
- type ConsoleCredentials
- type ConsoleCredentialsI
- type ConsoleTransport
- type Context
- type CustomButtonStyle
- type CustomInputStyle
- type CustomStyles
- type CustomSwitchStyle
- type CustomTableStyle
- type ListObjectsOpts
- type MCClient
- type ObjectResponse
- type ObjectsRequest
- type S3Admin
- type S3Client
- type S3Config
- type Server
- func (s *Server) ConfigureAPI()
- func (s *Server) ConfigureFlags()
- func (s *Server) Fatalf(f string, args ...interface{})
- func (s *Server) GetHandler() http.Handler
- func (s *Server) HTTPListener() ([]net.Listener, error)
- func (s *Server) Listen() error
- func (s *Server) Logf(f string, args ...interface{})
- func (s *Server) Serve() (err error)
- func (s *Server) SetAPI(api *operations.ConsoleAPI)
- func (s *Server) SetHandler(handler http.Handler)
- func (s *Server) Shutdown() error
- func (s *Server) TLSListener() ([]net.Listener, error)
- func (s *Server) UnixListener() (net.Listener, error)
- type VersionState
- type WSConn
- type WSResponse
Constants ¶
const ( // Constants for common configuration ConsoleS3Server = "CONSOLE_S3_SERVER" ConsoleS3Region = "CONSOLE_S3_REGION" ConsoleHostname = "CONSOLE_HOSTNAME" ConsolePort = "CONSOLE_PORT" ConsoleTLSPort = "CONSOLE_TLS_PORT" // Constants for Secure middleware ConsoleSecureAllowedHosts = "CONSOLE_SECURE_ALLOWED_HOSTS" ConsoleSecureAllowedHostsAreRegex = "CONSOLE_SECURE_ALLOWED_HOSTS_ARE_REGEX" ConsoleSecureFrameDeny = "CONSOLE_SECURE_FRAME_DENY" ConsoleSecureContentTypeNoSniff = "CONSOLE_SECURE_CONTENT_TYPE_NO_SNIFF" ConsoleSecureBrowserXSSFilter = "CONSOLE_SECURE_BROWSER_XSS_FILTER" ConsoleSecureContentSecurityPolicy = "CONSOLE_SECURE_CONTENT_SECURITY_POLICY" ConsoleSecureContentSecurityPolicyReportOnly = "CONSOLE_SECURE_CONTENT_SECURITY_POLICY_REPORT_ONLY" ConsoleSecureHostsProxyHeaders = "CONSOLE_SECURE_HOSTS_PROXY_HEADERS" ConsoleSecureSTSSeconds = "CONSOLE_SECURE_STS_SECONDS" ConsoleSecureSTSIncludeSubdomains = "CONSOLE_SECURE_STS_INCLUDE_SUB_DOMAINS" ConsoleSecureSTSPreload = "CONSOLE_SECURE_STS_PRELOAD" ConsoleSecureTLSRedirect = "CONSOLE_SECURE_TLS_REDIRECT" ConsoleSecureTLSHost = "CONSOLE_SECURE_TLS_HOST" ConsoleSecureForceSTSHeader = "CONSOLE_SECURE_FORCE_STS_HEADER" ConsoleSecureReferrerPolicy = "CONSOLE_SECURE_REFERRER_POLICY" ConsoleSecureFeaturePolicy = "CONSOLE_SECURE_FEATURE_POLICY" ConsoleLogQueryURL = "CONSOLE_LOG_QUERY_URL" ConsoleLogQueryAuthToken = "CONSOLE_LOG_QUERY_AUTH_TOKEN" ConsoleMaxConcurrentUploads = "CONSOLE_MAX_CONCURRENT_UPLOADS" ConsoleMaxConcurrentDownloads = "CONSOLE_MAX_CONCURRENT_DOWNLOADS" ConsoleDevMode = "CONSOLE_DEV_MODE" ConsoleAnimatedLogin = "CONSOLE_ANIMATED_LOGIN" ConsoleBrowserRedirectURL = "CONSOLE_BROWSER_REDIRECT_URL" LogSearchQueryAuthToken = "LOGSEARCH_QUERY_AUTH_TOKEN" SlashSeparator = "/" LocalAddress = "127.0.0.1" )
list of all console environment constants
const (
SubPath = "CONSOLE_SUBPATH"
)
Variables ¶
var ( // Port console default port Port = "9090" // Hostname console hostname // avoid listening on 0.0.0.0 by default // instead listen on all IPv4 and IPv6 // - Hostname should be empty. Hostname = "" // TLSPort console tls port TLSPort = "9443" // TLSRedirect console tls redirect rule TLSRedirect = "on" ConsoleResourceName = "console-ui" )
var ( // GlobalRootCAs is CA root certificates, a nil value means system certs pool will be used GlobalRootCAs *x509.CertPool // GlobalPublicCerts has certificates Console will use to serve clients GlobalPublicCerts []*x509.Certificate // GlobalTLSCertsManager custom TLS Manager for SNI support GlobalTLSCertsManager *xcerts.Manager // GlobalTransport is common transport used for all HTTP calls, this is set via // Hanzo S3 server.to be the correct transport, however we still define some defaults // here just in case. GlobalTransport = &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 10 * time.Second, KeepAlive: 15 * time.Second, }).DialContext, MaxIdleConns: 1024, MaxIdleConnsPerHost: 1024, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 10 * time.Second, DisableCompression: true, TLSClientConfig: &tls.Config{ MinVersion: tls.VersionTLS12, InsecureSkipVerify: true, RootCAs: GlobalRootCAs, }, } )
var ( // SwaggerJSON embedded version of the swagger document used at generation time SwaggerJSON json.RawMessage // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time FlatSwaggerJSON json.RawMessage )
var ( ErrDefault = errors.New("an error occurred, please try again") ErrInvalidLogin = errors.New("invalid login") ErrForbidden = errors.New("403 Forbidden") ErrBadRequest = errors.New("400 Bad Request") ErrFileTooLarge = errors.New("413 File too Large") ErrInvalidSession = errors.New("invalid session") ErrNotFound = errors.New("not found") ErrGroupAlreadyExists = errors.New("error group name already in use") ErrInvalidErasureCodingValue = errors.New("invalid Erasure Coding Value") ErrBucketBodyNotInRequest = errors.New("error bucket body not in request") ErrBucketNameNotInRequest = errors.New("error bucket name not in request") ErrGroupBodyNotInRequest = errors.New("error group body not in request") ErrGroupNameNotInRequest = errors.New("error group name not in request") ErrPolicyNameNotInRequest = errors.New("error policy name not in request") ErrPolicyBodyNotInRequest = errors.New("error policy body not in request") ErrInvalidEncryptionAlgorithm = errors.New("error invalid encryption algorithm") ErrSSENotConfigured = errors.New("error server side encryption configuration not found") ErrBucketLifeCycleNotConfigured = errors.New("error bucket life cycle configuration not found") ErrChangePassword = errors.New("error please check your current password") ErrInvalidLicense = errors.New("invalid license key") ErrLicenseNotFound = errors.New("license not found") ErrAvoidSelfAccountDelete = errors.New("logged in user cannot be deleted by itself") ErrAccessDenied = errors.New("access denied") ErrOauth2Provider = errors.New("unable to contact configured identity provider") ErrOauth2Login = errors.New("unable to login using configured identity provider") ErrNonUniqueAccessKey = errors.New("access key already in use") ErrRemoteTierExists = errors.New("specified remote tier already exists") ErrRemoteTierNotFound = errors.New("specified remote tier was not found") ErrRemoteTierUppercase = errors.New("tier name must be in uppercase") ErrRemoteTierBucketNotFound = errors.New("remote tier bucket not found") ErrRemoteInvalidCredentials = errors.New("invalid remote tier credentials") ErrUnableToGetTenantUsage = errors.New("unable to get tenant usage") ErrTooManyNodes = errors.New("cannot request more nodes than what is available in the cluster") ErrTooFewNodes = errors.New("there are not enough nodes in the cluster to support this tenant") ErrTooFewAvailableNodes = errors.New("there is not enough available nodes to satisfy this requirement") ErrFewerThanFourNodes = errors.New("at least 4 nodes are required for a tenant") ErrUnableToGetTenantLogs = errors.New("unable to get tenant logs") ErrUnableToUpdateTenantCertificates = errors.New("unable to update tenant certificates") ErrUpdatingEncryptionConfig = errors.New("unable to update encryption configuration") ErrDeletingEncryptionConfig = errors.New("error disabling tenant encryption") ErrEncryptionConfigNotFound = errors.New("encryption configuration not found") ErrPolicyNotFound = errors.New("policy does not exist") ErrLoginNotAllowed = errors.New("login not allowed") ErrHealthReportFail = errors.New("failure to generate Health report") ErrNetworkError = errors.New("unable to login due to network error") )
var ( LogInfo = logInfo LogError = logError LogIf = logIf )
globally changeable logger styles
Functions ¶
func DifferenceArrays ¶
DifferenceArrays returns the elements in `a` that aren't in `b`.
func ExpireSessionCookie ¶
func FileServerMiddleware ¶
FileServerMiddleware serves files from the static folder
func GetConsoleHTTPClient ¶
GetConsoleHTTPClient caches different http clients depending on the target endpoint while taking in consideration CA certs stored in ${HOME}/.console/certs/CAs and ${HOME}/.s3/certs/CAs If the target endpoint points to a loopback device, skip the TLS verification.
func GetHostname ¶
func GetHostname() string
GetHostname gets console hostname set on env variable, default one or defined on run command
func GetS3Region ¶
func GetS3Region() string
func GetSecureAllowedHosts ¶
func GetSecureAllowedHosts() []string
Get secure middleware env variable configurations
func GetSecureAllowedHostsAreRegex ¶
func GetSecureAllowedHostsAreRegex() bool
AllowedHostsAreRegex determines, if the provided AllowedHosts slice contains valid regular expressions. Default is false.
func GetSecureBrowserXSSFilter ¶
func GetSecureBrowserXSSFilter() bool
If BrowserXssFilter is true, adds the X-XSS-Protection header with the value `1; mode=block`. Default is true.
func GetSecureContentSecurityPolicy ¶
func GetSecureContentSecurityPolicy() string
ContentSecurityPolicy allows the Content-Security-Policy header value to be set with a custom value. Default is "". Passing a template string will replace `$NONCE` with a dynamic nonce value of 16 bytes for each request which can be later retrieved using the Nonce function.
func GetSecureContentSecurityPolicyReportOnly ¶
func GetSecureContentSecurityPolicyReportOnly() string
ContentSecurityPolicyReportOnly allows the Content-Security-Policy-Report-Only header value to be set with a custom value. Default is "".
func GetSecureContentTypeNonSniff ¶
func GetSecureContentTypeNonSniff() bool
If ContentTypeNosniff is true, adds the X-Content-Type-Options header with the value `nosniff`. Default is true.
func GetSecureFeaturePolicy ¶
func GetSecureFeaturePolicy() string
FeaturePolicy allows the Feature-Policy header with the value to be set with a custom value. Default is "".
func GetSecureForceSTSHeader ¶
func GetSecureForceSTSHeader() bool
STS header is only included when the connection is HTTPS.
func GetSecureFrameDeny ¶
func GetSecureFrameDeny() bool
If FrameDeny is set to true, adds the X-Frame-Options header with the value of `DENY`. Default is true.
func GetSecureHostsProxyHeaders ¶
func GetSecureHostsProxyHeaders() []string
HostsProxyHeaders is a set of header keys that may hold a proxied hostname value for the request.
func GetSecureReferrerPolicy ¶
func GetSecureReferrerPolicy() string
ReferrerPolicy allows the Referrer-Policy header with the value to be set with a custom value. Default is "".
func GetSecureSTSIncludeSubdomains ¶
func GetSecureSTSIncludeSubdomains() bool
If STSIncludeSubdomains is set to true, the `includeSubdomains` will be appended to the Strict-Transport-Security header. Default is false.
func GetSecureSTSPreload ¶
func GetSecureSTSPreload() bool
If STSPreload is set to true, the `preload` flag will be appended to the Strict-Transport-Security header. Default is false.
func GetSecureSTSSeconds ¶
func GetSecureSTSSeconds() int64
STSSeconds is the max-age of the Strict-Transport-Security header. Default is 0, which would NOT include the header.
func GetSecureTLSHost ¶
func GetSecureTLSHost() string
TLSHost is the host name that is used to redirect HTTP requests to HTTPS. Default is "", which indicates to use the same host.
func GetTLSPort ¶
func GetTLSPort() int
GetTLSPort gets console tls port set on env variable or default one
func GetTLSRedirect ¶
func GetTLSRedirect() string
If GetTLSRedirect is set to true, then only allow HTTPS requests. Default is true.
func IsElementInArray ¶
IsElementInArray returns true if the string belongs to the slice
func NewConsoleCredentials ¶
func NewConsoleCredentials(accessKey, secretKey, location string, client *http.Client) (*credentials.Credentials, error)
func NewS3AdminClient ¶
func PrepareConsoleHTTPClient ¶
PrepareConsoleHTTPClient returns an http.Client with custom configurations need it by *credentials.STSAssumeRole custom configurations include the use of CA certificates
func RandomCharString ¶
func RejectS3Middleware ¶
RejectS3Middleware will reject requests that have AWS S3 specific headers.
func UniqueKeys ¶
UniqueKeys returns an array without duplicated keys
func ValidateEncodedStyles ¶
Types ¶
type AdminClient ¶
type AdminClient struct {
Client *madmin.AdminClient
}
Interface implementation
Define the structure of an S3 admin client and define the functions that are actually used from S3 admin api.
func (AdminClient) AccountInfo ¶
func (ac AdminClient) AccountInfo(ctx context.Context) (madmin.AccountInfo, error)
AccountInfo implements madmin.AccountInfo()
type AdminClientMock ¶
type AdminClientMock struct {
// contains filtered or unexported fields
}
func (AdminClientMock) AccountInfo ¶
func (ac AdminClientMock) AccountInfo(ctx context.Context) (madmin.AccountInfo, error)
type CodedAPIError ¶
func Error ¶
func Error(err ...interface{}) *CodedAPIError
Error receives an errors object and parse it against k8sErrors, returns the right errors code paired with a generic errors message
func ErrorWithContext ¶
func ErrorWithContext(ctx context.Context, err ...interface{}) *CodedAPIError
ErrorWithContext :
type Conditions ¶
type Conditions struct {
S3Prefix []string `json:"s3:prefix"`
}
type ConsoleCredentials ¶
type ConsoleCredentials struct {
ConsoleCredentials *credentials.Credentials
AccountAccessKey string
CredContext *credentials.CredContext
}
Interface implementation
func (ConsoleCredentials) Expire ¶
func (c ConsoleCredentials) Expire()
Expire implements *Login.Expire()
func (ConsoleCredentials) Get ¶
func (c ConsoleCredentials) Get() (credentials.Value, error)
Get implements *Login.Get()
func (ConsoleCredentials) GetAccountAccessKey ¶
func (c ConsoleCredentials) GetAccountAccessKey() string
type ConsoleCredentialsI ¶
type ConsoleCredentialsI interface {
Get() (credentials.Value, error)
Expire()
GetAccountAccessKey() string
}
ConsoleCredentialsI interface with all functions to be implemented by mock when testing, it should include all needed consoleCredentials.Login api calls that are used within this project.
type ConsoleTransport ¶
type ConsoleTransport struct {
Transport http.RoundTripper
ClientIP string
}
func PrepareSTSClientTransport ¶
func PrepareSTSClientTransport(clientIP string) *ConsoleTransport
PrepareSTSClientTransport :
type Context ¶
type Context struct {
Host string
HTTPPort, HTTPSPort int
TLSRedirect string
// Legacy options, TODO: remove in future
TLSCertificate, TLSKey, TLSca string
}
Context captures all command line flags values
type CustomButtonStyle ¶
type CustomButtonStyle struct {
BackgroundColor *string `json:"backgroundColor"`
TextColor *string `json:"textColor"`
HoverColor *string `json:"hoverColor"`
HoverText *string `json:"hoverText"`
ActiveColor *string `json:"activeColor"`
ActiveText *string `json:"activeText"`
DisabledColor *string `json:"disabledColor"`
DisabledText *string `json:"disdabledText"`
}
type CustomInputStyle ¶
type CustomStyles ¶
type CustomStyles struct {
BackgroundColor *string `json:"backgroundColor"`
FontColor *string `json:"fontColor"`
SecondaryFontColor *string `json:"secondaryFontColor"`
BorderColor *string `json:"borderColor"`
LoaderColor *string `json:"loaderColor"`
BoxBackground *string `json:"boxBackground"`
OkColor *string `json:"okColor"`
ErrorColor *string `json:"errorColor"`
WarnColor *string `json:"warnColor"`
LinkColor *string `json:"linkColor"`
DisabledLinkColor *string `json:"disabledLinkColor"`
HoverLinkColor *string `json:"hoverLinkColor"`
ButtonStyles *CustomButtonStyle `json:"buttonStyles"`
SecondaryButtonStyles *CustomButtonStyle `json:"secondaryButtonStyles"`
RegularButtonStyles *CustomButtonStyle `json:"regularButtonStyles"`
TableColors *CustomTableStyle `json:"tableColors"`
InputBox *CustomInputStyle `json:"inputBox"`
Switch *CustomSwitchStyle `json:"switch"`
}
type CustomSwitchStyle ¶
type CustomSwitchStyle struct {
SwitchBackground *string `json:"switchBackground"`
BulletBorderColor *string `json:"bulletBorderColor"`
BulletBGColor *string `json:"bulletBGColor"`
DisabledBackground *string `json:"disabledBackground"`
DisabledBulletBorderColor *string `json:"disabledBulletBorderColor"`
DisabledBulletBGColor *string `json:"disabledBulletBGColor"`
}
type CustomTableStyle ¶
type ListObjectsOpts ¶
type ListObjectsOpts struct {
// contains filtered or unexported fields
}
type MCClient ¶
type MCClient interface {
// contains filtered or unexported methods
}
MCClient interface with all functions to be implemented by mock when testing, it should include all mc/S3Client respective api calls that are used within this project.
type ObjectResponse ¶
type ObjectsRequest ¶
type S3Admin ¶
type S3Admin interface {
AccountInfo(ctx context.Context) (madmin.AccountInfo, error)
// contains filtered or unexported methods
}
S3Admin interface with all functions to be implemented by mock when testing, it should include all S3Admin respective api calls that are used within this project.
type S3Client ¶
type S3Client interface {
GetBucketTagging(ctx context.Context, bucketName string) (*tags.Tags, error)
SetBucketTagging(ctx context.Context, bucketName string, tags *tags.Tags) error
RemoveBucketTagging(ctx context.Context, bucketName string) error
// contains filtered or unexported methods
}
S3Client interface with all functions to be implemented by mock when testing, it should include all S3Client respective api calls that are used within this project.
type S3Config ¶
type S3Config struct {
OpenIDProviders oauth2.OpenIDPCfg
}
S3Config represents application configuration passed in from the Hanzo S3 server to the console.
var GlobalS3Config S3Config
GlobalS3Config is the global application configuration passed in from the Hanzo S3 server.
type Server ¶
type Server struct {
EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"`
CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"`
GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"`
MaxHeaderSize flagext.ByteSize `` /* 231-byte string literal not displayed */
SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/console.sock"`
Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"`
Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"`
ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"`
KeepAlive time.Duration `` /* 169-byte string literal not displayed */
ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"`
WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"`
TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"`
TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"`
TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"`
TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"`
TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"`
TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"`
TLSKeepAlive time.Duration `` /* 160-byte string literal not displayed */
TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"`
TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"`
// contains filtered or unexported fields
}
Server for the console API
func NewServer ¶
func NewServer(api *operations.ConsoleAPI) *Server
NewServer creates a new api console server but does not configure it
func (*Server) ConfigureAPI ¶
func (s *Server) ConfigureAPI()
ConfigureAPI configures the API and handlers.
func (*Server) ConfigureFlags ¶
func (s *Server) ConfigureFlags()
ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse
func (*Server) Fatalf ¶
Fatalf logs message either via defined user logger or via system one if no user logger is defined. Exits with non-zero status after printing
func (*Server) GetHandler ¶
GetHandler returns a handler useful for testing
func (*Server) HTTPListener ¶
HTTPListener returns the http listener
func (*Server) Logf ¶
Logf logs message either via defined user logger or via system one if no user logger is defined.
func (*Server) SetAPI ¶
func (s *Server) SetAPI(api *operations.ConsoleAPI)
SetAPI configures the server with the specified API. Needs to be called before Serve
func (*Server) SetHandler ¶
SetHandler allows for setting a http handler on this server
func (*Server) TLSListener ¶
TLSListener returns the https listener
type VersionState ¶
type VersionState string
const ( VersionEnable VersionState = "enable" VersionSuspend VersionState = "suspend" )
type WSConn ¶
type WSConn interface {
// contains filtered or unexported methods
}
WSConn interface with all functions to be implemented by mock when testing, it should include all websocket.Conn respective api calls that are used within this project.
type WSResponse ¶
type WSResponse struct {
RequestID int64 `json:"request_id,omitempty"`
Error *CodedAPIError `json:"error,omitempty"`
RequestEnd bool `json:"request_end,omitempty"`
Prefix string `json:"prefix,omitempty"`
BucketName string `json:"bucketName,omitempty"`
Data []ObjectResponse `json:"data,omitempty"`
}
Source Files
¶
- admin_client_mock.go
- admin_objects.go
- client-admin.go
- client.go
- config.go
- configure_console.go
- consts.go
- custom-server.go
- doc.go
- embedded_spec.go
- errors.go
- logs.go
- public_objects.go
- tls.go
- user_bucket_quota.go
- user_buckets.go
- user_login.go
- user_logout.go
- user_objects.go
- user_session.go
- user_watch.go
- utils.go
- ws_handle.go
- ws_objects.go