Documentation ¶
Index ¶
- Constants
- func Asset(name string) ([]byte, error)
- func AssetDigest(name string) ([sha256.Size]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func AssetString(name string) (string, error)
- func Digests() (map[string][sha256.Size]byte, error)
- func GetPartitionFromMsgID(id int64) int
- func LogoutUser(ctx *Context, w http.ResponseWriter, req *http.Request) error
- func MustAsset(name string) []byte
- func MustAssetString(name string) string
- func NewHTTPServer(ctx *Context) *httpServer
- func NewSingleHostReverseProxy(target *url.URL, timeout time.Duration) *httputil.ReverseProxy
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type AccessControl
- type AdminAction
- type CasResponse
- type CasResponseValue
- type CasUserModel
- func (u *CasUserModel) DoAuth(w http.ResponseWriter, req *http.Request) error
- func (u *CasUserModel) GetUserName() string
- func (u *CasUserModel) GetUserRole() string
- func (u *CasUserModel) IsAdmin() bool
- func (u *CasUserModel) IsLogin() bool
- func (u *CasUserModel) SetContext(ctx *Context) error
- func (u *CasUserModel) String() string
- type ChannelActionRequest
- type ChannelByDelayedQueue
- type ChannelByRequeue
- type ChannelByTimeout
- type Context
- type DCLookupdAddrs
- type IUserAuth
- type IndexFieldsQuery
- type NSQAdmin
- type Options
- type QueryPairs
- type RankList
- type TLListT
- type TopicsByChannelDepth
- type TopicsByHourlyPubsize
- type TraceLog
- type TraceLogData
- type TraceLogDataForJs
- type TraceLogItemInfo
- type TraceLogItemInfoForJs
- type TraceLogQueryInfo
- type TraceLogResp
- type YamlAccessControl
Constants ¶
const (
MAX_INCR_ID_BIT = 50
)
Variables ¶
This section is empty.
Functions ¶
func Asset ¶ added in v0.3.6
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDigest ¶
AssetDigest returns the digest of the file with the given name. It returns an error if the asset could not be found or the digest could not be loaded.
func AssetDir ¶ added in v0.3.6
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"}, AssetDir("data/img") would return []string{"a.png", "b.png"}, AssetDir("foo.txt") and AssetDir("notexist") would return an error, and AssetDir("") will return []string{"data"}.
func AssetInfo ¶ added in v0.3.6
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetNames ¶ added in v0.3.6
func AssetNames() []string
AssetNames returns the names of the assets.
func AssetString ¶
AssetString returns the asset contents as a string (instead of a []byte).
func GetPartitionFromMsgID ¶
func LogoutUser ¶
func MustAsset ¶ added in v0.3.6
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func MustAssetString ¶
MustAssetString is like AssetString but panics when Asset would return an error. It simplifies safe initialization of global variables.
func NewHTTPServer ¶ added in v0.2.25
func NewHTTPServer(ctx *Context) *httpServer
func NewSingleHostReverseProxy ¶ added in v0.2.16
this is similar to httputil.NewSingleHostReverseProxy except it passes along basic auth
func RestoreAsset ¶ added in v0.3.6
RestoreAsset restores an asset under the given directory.
func RestoreAssets ¶ added in v0.3.6
RestoreAssets restores an asset under the given directory recursively.
Types ¶
type AccessControl ¶
func NewYamlAccessControl ¶
func NewYamlAccessControl(ctx *Context, filePath string) (AccessControl, error)
type AdminAction ¶ added in v0.2.17
type AdminAction struct { Action string `json:"action"` Topic string `json:"topic"` Order bool `json:"order"` Channel string `json:"channel,omitempty"` Node string `json:"node,omitempty"` Timestamp int64 `json:"timestamp"` User string `json:"user,omitempty"` RemoteIP string `json:"remote_ip"` UserAgent string `json:"user_agent"` URL string `json:"url"` // The URL of the HTTP request that triggered this action Via string `json:"via"` // the Hostname of the nsqadmin performing this action }
func (*AdminAction) String ¶
func (a *AdminAction) String() string
type CasResponse ¶
type CasResponse struct { Code int Msg string Data *CasResponseValue }
type CasResponseValue ¶
type CasResponseValue struct {
Value *CasUserModel
}
type CasUserModel ¶
type CasUserModel struct { Id int64 UserName string Gender bool RealName string Aliasna string Mobile string Email string Login bool // contains filtered or unexported fields }
func NewCasUserModel ¶
func NewCasUserModel(ctx *Context, w http.ResponseWriter, req *http.Request) (*CasUserModel, error)
func (*CasUserModel) DoAuth ¶
func (u *CasUserModel) DoAuth(w http.ResponseWriter, req *http.Request) error
func (*CasUserModel) GetUserName ¶
func (u *CasUserModel) GetUserName() string
func (*CasUserModel) GetUserRole ¶
func (u *CasUserModel) GetUserRole() string
func (*CasUserModel) IsAdmin ¶
func (u *CasUserModel) IsAdmin() bool
func (*CasUserModel) IsLogin ¶
func (u *CasUserModel) IsLogin() bool
func (*CasUserModel) SetContext ¶
func (u *CasUserModel) SetContext(ctx *Context) error
func (*CasUserModel) String ¶
func (u *CasUserModel) String() string
type ChannelActionRequest ¶
type ChannelByDelayedQueue ¶
type ChannelByDelayedQueue struct {
RankList
}
func (ChannelByDelayedQueue) Less ¶
func (c ChannelByDelayedQueue) Less(i, j int) bool
type ChannelByRequeue ¶
type ChannelByRequeue struct {
RankList
}
func (ChannelByRequeue) Less ¶
func (c ChannelByRequeue) Less(i, j int) bool
type ChannelByTimeout ¶
type ChannelByTimeout struct {
RankList
}
func (ChannelByTimeout) Less ¶
func (c ChannelByTimeout) Less(i, j int) bool
type DCLookupdAddrs ¶
type IUserAuth ¶
type IndexFieldsQuery ¶
type NSQAdmin ¶ added in v0.2.25
func (*NSQAdmin) DC2LookupAddresses ¶
func (*NSQAdmin) IsAuthEnabled ¶
func (*NSQAdmin) RealHTTPAddr ¶ added in v0.3.3
type Options ¶ added in v0.3.6
type Options struct { HTTPAddress string `flag:"http-address"` GraphiteURL string `flag:"graphite-url"` ProxyGraphite bool `flag:"proxy-graphite"` UseStatsdPrefixes bool `flag:"use-statsd-prefixes"` StatsdPrefix string `flag:"statsd-prefix"` StatsdCounterFormat string `flag:"statsd-counter-format"` StatsdGaugeFormat string `flag:"statsd-gauge-format"` StatsdInterval time.Duration `flag:"statsd-interval"` NSQLookupdHTTPAddresses []string `flag:"lookupd-http-address" cfg:"nsqlookupd_http_addresses"` NSQDHTTPAddresses []string `flag:"nsqd-http-address" cfg:"nsqd_http_addresses"` DCNSQLookupdHTTPAddresses []string `flag:"dc-lookupd-http-address" cfg:"dc_lookupd_http_addresses"` NSQLookupdHTTPAddressesDC []clusterinfo.LookupdAddressDC HTTPClientTLSInsecureSkipVerify bool `flag:"http-client-tls-insecure-skip-verify"` HTTPClientTLSRootCAFile string `flag:"http-client-tls-root-ca-file"` HTTPClientTLSCert string `flag:"http-client-tls-cert"` HTTPClientTLSKey string `flag:"http-client-tls-key"` NotificationHTTPEndpoint string `flag:"notification-http-endpoint"` TraceQueryURL string `flag:"trace-query-url"` TraceAppID string `flag:"trace-app-id"` TraceAppName string `flag:"trace-app-name"` TraceLogIndexID string `flag:"trace-log-index-id"` TraceLogIndexName string `flag:"trace-log-index-name"` TraceLogPageCount int `flag:"trace-log-page-count"` ChannelCreationRetry int `flag:"channel-create-retry"` ChannelCreationBackoffInterval int `flag:"channel-create-backoff-interval"` AuthUrl string `flag:"auth-url" cfg:"auth_url"` AuthSecret string `flag:"auth-secret" cfg:"auth_secret"` LogoutUrl string `flag:"logout-url" cfg:"logout_url"` AppName string `flag:"app-name" cfg:"app_name"` RedirectUrl string `flag:"redirect-url" cfg:"redirect_url"` LogDir string `flag:"log-dir" cfg:"log_dir"` Logger levellogger.Logger AccessTokens []string `flag:"access-tokens" cfg:"access_tokens"` AccessControlFile string `flag:"access-control-file"` EnableZanTestSkip bool `flag:"enable-zan-test-skip"` }
func NewOptions ¶ added in v0.3.6
func NewOptions() *Options
type QueryPairs ¶
type TLListT ¶
type TLListT []TraceLogData
type TopicsByChannelDepth ¶
type TopicsByChannelDepth struct {
RankList
}
func (TopicsByChannelDepth) Less ¶
func (c TopicsByChannelDepth) Less(i, j int) bool
type TopicsByHourlyPubsize ¶
type TopicsByHourlyPubsize struct {
RankList
}
func (TopicsByHourlyPubsize) Less ¶
func (c TopicsByHourlyPubsize) Less(i, j int) bool
type TraceLog ¶
type TraceLog struct { LogDataDtos []TraceLogData `json:"logDataDtos"` TotalCount int `json:"totalCount"` }
type TraceLogData ¶
type TraceLogData struct { ID string `json:"id"` Time string `json:"time"` Level string `json:"level"` HostIp string `json:"hostIp"` HostName string `json:"hostName"` Content string `json:"content"` Extra string `json:"extra"` Extra1 string `json:"extra1"` TraceLogItemInfo RawMsgData string `json:"raw_msg_data"` DC string `json:"dc"` RawMsgDataDC map[string]string `json:"raw_msg_data_dc"` }
type TraceLogDataForJs ¶
type TraceLogDataForJs struct { TraceLogItemInfoForJs RawMsgData string `json:"raw_msg_data"` }
type TraceLogItemInfo ¶
type TraceLogItemInfo struct { MsgID uint64 `json:"msgid"` TraceID uint64 `json:"traceid"` Topic string `json:"topic"` Channel string `json:"channel"` Timestamp int64 `json:"timestamp"` Action string `json:"action"` }
func (TraceLogItemInfo) ToJsJson ¶
func (tl TraceLogItemInfo) ToJsJson() TraceLogItemInfoForJs
type TraceLogItemInfoForJs ¶
type TraceLogQueryInfo ¶
type TraceLogQueryInfo struct { Sort string `json:"sort"` AppName string `json:"appName"` LogIndexName string `json:"logIndexName"` Level string `json:"level"` Host string `json:"host"` Content string `json:"content"` // 2017-01-01 00:00:00 StartTime string `json:"startTime"` EndTime string `json:"endTime"` IndexFields string `json:"indexFields"` PageNumber int `json:"pageNumber"` PageSize int `json:"pageSize"` Type int `json:"type"` }
func NewLogQueryInfo ¶
func NewLogQueryInfo(appName string, logIndexName string, span time.Duration, indexFields IndexFieldsQuery, pageCnt int) *TraceLogQueryInfo
type TraceLogResp ¶
type YamlAccessControl ¶
type YamlAccessControl struct {
// contains filtered or unexported fields
}
func (*YamlAccessControl) IsAdmin ¶
func (ac *YamlAccessControl) IsAdmin(username string) bool
func (*YamlAccessControl) Start ¶
func (ac *YamlAccessControl) Start()
func (*YamlAccessControl) Stop ¶
func (ac *YamlAccessControl) Stop()