Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCamelCaseLabel(field string) string
- func DeduplicatePersistenceServices(servicesSummary config.ServicesSummaries) []config.ServiceSummary
- func DeduplicateServices(servicesSummary config.ServicesSummaries, serviceType string) []config.ServiceSummary
- func DeduplicateSessions(httpSummary config.HTTPSessionSummaries) []config.HTTPSessionSummary
- func Execute(version string, date string, commit string)
- func FormatCacheDetailsSizeAndAccess(cacheDetails []config.CacheDetail) string
- func FormatCacheDetailsStorage(cacheDetails []config.CacheDetail) string
- func FormatCacheIndexDetails(cacheDetails []config.CacheDetail) string
- func FormatCachePartitions(cacheDetails []config.CachePartitionDetail, summary bool) string
- func FormatCacheStoreDetails(cacheDetails []config.CacheStoreDetail, cache, service string, ...) string
- func FormatCacheSummary(cacheSummaries []config.CacheSummaryDetail) string
- func FormatChannelStats(channelStats []config.ChannelStats) string
- func FormatCluster(cluster config.Cluster) string
- func FormatClusterConnections(clusters []ClusterConnection) string
- func FormatCurrentCluster(clusterName string) string
- func FormatDepartedMembers(members []config.DepartedMembers) string
- func FormatDiscoveredClusters(clusters []discovery.DiscoveredCluster) string
- func FormatElasticData(edData []config.ElasticData, summary bool) string
- func FormatExecutors(executors []config.Executor, summary bool) string
- func FormatFederationDetails(federationDetails []config.FederationDescription, target string) string
- func FormatFederationSummary(federationSummaries []config.FederationSummary, target string) string
- func FormatHTTPSessions(sessions []config.HTTPSessionSummary, isSummary bool) string
- func FormatHeadsStats(channelStats []config.HeadStats) string
- func FormatHealthMonitoring(health []config.HealthMonitoring) string
- func FormatHealthSummary(health []config.HealthSummaryShort) string
- func FormatJSONForDescribe(jsonValue []byte, showAllColumns bool, orderedColumns ...string) (string, error)
- func FormatMachines(machines []config.Machine) string
- func FormatMemberHealth(health []config.HealthSummary) string
- func FormatMembers(members []config.Member, verbose bool, storageMap map[int]bool, summary bool, ...) string
- func FormatNetworkStatistics(members []config.Member) string
- func FormatNetworkStats(details []config.NetworkStatsDetails) string
- func FormatPersistenceServices(services []config.ServiceSummary, isSummary bool) string
- func FormatProfiles(profiles []ProfileValue) string
- func FormatProxyConnections(connections []config.ProxyConnection) string
- func FormatProxyServers(services []config.ProxySummary, protocol string) string
- func FormatReporters(reporters []config.Reporter) string
- func FormatServiceMembers(serviceMembers []config.ServiceMemberDetail) string
- func FormatServices(services []config.ServiceSummary) string
- func FormatServicesStorage(services []config.ServiceStorageSummary) string
- func FormatSnapshots(serviceSnapshots []config.Snapshots, archived bool) string
- func FormatSubscriberChannelStats(channelStats []config.SubscriberChannelStats) string
- func FormatSubscriberGroupChannelStats(channelStats []config.SubscriberGroupChannelStats) string
- func FormatTopicsMembers(topicsMembers []config.TopicsMemberDetail) string
- func FormatTopicsSubscriberGroups(subscriberGroups []config.TopicsSubscriberGroupDetail) string
- func FormatTopicsSubscribers(topicsSubscribers []config.TopicsSubscriberDetail) string
- func FormatTopicsSummary(topicDetails []config.TopicDetail) string
- func FormatTracing(members []config.Member) string
- func FormatViewCacheDetail(cacheDetails []config.ViewCacheDetail) string
- func FormatViewCacheSummary(cacheSummaries []config.ViewCacheSummaryDetail) string
- func GetArchivedSnapshots(dataFetcher fetcher.Fetcher, serviceName string) ([]string, error)
- func GetConfigDir() string
- func GetConnectionAndDataFetcher() (string, fetcher.Fetcher, error)
- func GetConnectionNameFromContextOrArg() (string, error)
- func GetDataFetcher(clusterName string) (fetcher.Fetcher, error)
- func GetDistributedServices(dataFetcher fetcher.Fetcher) ([]string, error)
- func GetFederatedServices(dataFetcher fetcher.Fetcher) ([]string, error)
- func GetFileName(nodeID string, iteration int32) string
- func GetListOfCacheServices(servicesSummary config.ServicesSummaries) []string
- func GetLogDirectory() string
- func GetMachineList(dataFetcher fetcher.Fetcher) (map[string]string, error)
- func GetNodeIds(dataFetcher fetcher.Fetcher) ([]string, error)
- func GetPersistenceServices(dataFetcher fetcher.Fetcher) ([]string, error)
- func GetServices(dataFetcher fetcher.Fetcher) (config.ServicesSummaries, error)
- func GetSnapshots(dataFetcher fetcher.Fetcher, serviceName string) ([]string, error)
- func GetURLContents(resourceURL string) ([]byte, error)
- func Initialize(command *cobra.Command) *cobra.Command
- func IssueFederationCommand(cmd *cobra.Command, serviceName, command, participant, mode string) error
- func IssueReporterCommand(nodeID, command string, cmd *cobra.Command) error
- func ServiceExists(dataFetcher fetcher.Fetcher, serviceName string) (bool, error)
- func SetRootCommandFlags(command *cobra.Command)
- func UnmarshalThreadDump(jsonData []byte) (string, error)
- func WriteConfig() error
- type ByteArraySink
- type ClusterConnection
- type CoherenceCLIConfig
- type ErrorSink
- type FormattedTable
- type KeyValues
- type ProfileValue
Constants ¶
const ( R = "R" L = "L" NodeIDColumn = "NODE ID" SubscriberIDColumn = "SUBSCRIBER ID" ServiceColumn = "SERVICE" CacheColumn = "CACHE" CountColumn = "COUNT" PolledColumn = "POLLED" HeadColumn = "HEAD" HitProbColumn = "HIT PROB" ChannelsColumn = "CHANNELS" ChannelColumn = "CHANNEL" SubscriberGroupColumn = "SUBSCRIBER GROUP" PublishedColumn = "PUBLISHED" MeanColumn = "MEAN" OneMinuteColumn = "1 MIN" FiveMinuteColumn = "5 MIN" FifteenMinuteColumn = "15 MIN" ServiceNameColumn = "SERVICE NAME" AddressColumn = "ADDRESS" PortColumn = "PORT" MemberColumn = "MEMBER" MembersColumn = "MEMBERS" RoleColumn = "ROLE" ProcessColumn = "PROCESS" MaxHeapColumn = "MAX HEAP" UsedHeapColumn = "USED HEAP" AvailHeapColumn = "AVAIL HEAP" NameColumn = "NAME" )
const ( SupplyTopicMessage = "you must provide a topic" NoTopicForService = "there are no topics for service %s" TopicDoesNotExist = "a topic named %s does not exist for service %s" )
const (
OperationCompleted = "operation completed"
)
various command constants
const (
UnableToFindClusterMsg = "unable to find cluster with connection name "
)
Variables ¶
var ( ElasticDataMessage = fmt.Sprintf("name must be %s or %s", ram, flash) ErrInvalidType = errors.New(ElasticDataMessage) )
var ( // Config is the CLI config Config CoherenceCLIConfig // Username contains the current username Username string // UsingContext indicates if we are using a context via the set context command UsingContext bool Logger *zap.Logger // Version is the cohctl version injected by the Go linker at build time. Version string // Commit is the git commit hash injected by the Go linker at build time. Commit string // Date is the build timestamp injected by the Go linker at build time. Date string )
var ( // ArchivedSnapshots indicates if we are working with archived snapshots ArchivedSnapshots bool )
var (
InvalidTierMsg = "tier must be back or front"
)
var (
NodeID string
)
var (
OutputFormat string
)
Functions ¶
func CreateCamelCaseLabel ¶
CreateCamelCaseLabel creates a camel case label from a field, e.g. unicastListener becomes "Unicast Listener".
func DeduplicatePersistenceServices ¶
func DeduplicatePersistenceServices(servicesSummary config.ServicesSummaries) []config.ServiceSummary
DeduplicatePersistenceServices removes duplicated persistence details.
func DeduplicateServices ¶
func DeduplicateServices(servicesSummary config.ServicesSummaries, serviceType string) []config.ServiceSummary
DeduplicateServices removes duplicated service details.
func DeduplicateSessions ¶
func DeduplicateSessions(httpSummary config.HTTPSessionSummaries) []config.HTTPSessionSummary
DeduplicateSessions removes duplicated http session details.
func FormatCacheDetailsSizeAndAccess ¶
func FormatCacheDetailsSizeAndAccess(cacheDetails []config.CacheDetail) string
FormatCacheDetailsSizeAndAccess returns the cache details size and access details in column formatted output.
func FormatCacheDetailsStorage ¶
func FormatCacheDetailsStorage(cacheDetails []config.CacheDetail) string
FormatCacheDetailsStorage returns the cache storage details in column formatted output.
func FormatCacheIndexDetails ¶
func FormatCacheIndexDetails(cacheDetails []config.CacheDetail) string
FormatCacheIndexDetails returns the cache index details.
func FormatCachePartitions ¶
func FormatCachePartitions(cacheDetails []config.CachePartitionDetail, summary bool) string
FormatCachePartitions returns the cache partition details in column formatted output.
func FormatCacheStoreDetails ¶
func FormatCacheStoreDetails(cacheDetails []config.CacheStoreDetail, cache, service string, includeHeader bool) string
FormatCacheStoreDetails returns the cache store details in column formatted output.
func FormatCacheSummary ¶
func FormatCacheSummary(cacheSummaries []config.CacheSummaryDetail) string
FormatCacheSummary returns the cache summary in column formatted output.
func FormatChannelStats ¶
func FormatChannelStats(channelStats []config.ChannelStats) string
FormatChannelStats returns the channel stats in column formatted output.
func FormatCluster ¶
FormatCluster returns a string representing a cluster.
func FormatClusterConnections ¶
func FormatClusterConnections(clusters []ClusterConnection) string
FormatClusterConnections returns the cluster information in a column formatted output.
func FormatCurrentCluster ¶
FormatCurrentCluster will display a message indicating a cluster context is being used.
func FormatDepartedMembers ¶
func FormatDepartedMembers(members []config.DepartedMembers) string
FormatDepartedMembers returns the departed member's information in a column formatted output.
func FormatDiscoveredClusters ¶
func FormatDiscoveredClusters(clusters []discovery.DiscoveredCluster) string
FormatDiscoveredClusters returns the discovered clusters in the column formatted output.
func FormatElasticData ¶
func FormatElasticData(edData []config.ElasticData, summary bool) string
FormatElasticData formats the elastic data summary.
func FormatExecutors ¶
FormatExecutors returns the executor's information in a column formatted output.
func FormatFederationDetails ¶
func FormatFederationDetails(federationDetails []config.FederationDescription, target string) string
func FormatFederationSummary ¶
func FormatFederationSummary(federationSummaries []config.FederationSummary, target string) string
FormatFederationSummary returns the federation summary in column formatted output the target may be destinations or origins and columns will change slightly.
func FormatHTTPSessions ¶
func FormatHTTPSessions(sessions []config.HTTPSessionSummary, isSummary bool) string
FormatHTTPSessions returns the Coherence*Web information in a column formatted output.
func FormatHeadsStats ¶
FormatHeadsStats returns the subscriber heads stats in column formatted output.
func FormatHealthMonitoring ¶
func FormatHealthMonitoring(health []config.HealthMonitoring) string
FormatHealthMonitoring returns the healt HTTP endpoints..
func FormatHealthSummary ¶
func FormatHealthSummary(health []config.HealthSummaryShort) string
FormatHealthSummary returns member health in a short or summary view.
func FormatJSONForDescribe ¶
func FormatJSONForDescribe(jsonValue []byte, showAllColumns bool, orderedColumns ...string) (string, error)
FormatJSONForDescribe formats a two column display for a describe command showAllColumns indicates if all the columns including ordered are shown orderedColumns are the column names, expanded, that should be displayed first for context.
func FormatMachines ¶
FormatMachines returns the machine's information in a column formatted output.
func FormatMemberHealth ¶
func FormatMemberHealth(health []config.HealthSummary) string
FormatMemberHealth returns member health in a column formatted output.
func FormatMembers ¶
func FormatMembers(members []config.Member, verbose bool, storageMap map[int]bool, summary bool, departureCount int) string
FormatMembers returns the member's information in a column formatted output.
func FormatNetworkStatistics ¶
FormatNetworkStatistics returns all the member's network statistics in a column formatted output.
func FormatNetworkStats ¶
func FormatNetworkStats(details []config.NetworkStatsDetails) string
FormatNetworkStats formats the network stats.
func FormatPersistenceServices ¶
func FormatPersistenceServices(services []config.ServiceSummary, isSummary bool) string
FormatPersistenceServices returns the services' persistence information in a column formatted output if isSummary then leave out storage count.
func FormatProfiles ¶
func FormatProfiles(profiles []ProfileValue) string
FormatProfiles returns the profiles in a column formatted output.
func FormatProxyConnections ¶
func FormatProxyConnections(connections []config.ProxyConnection) string
FormatProxyConnections returns the proxy connections in a column formatted output.
func FormatProxyServers ¶
func FormatProxyServers(services []config.ProxySummary, protocol string) string
FormatProxyServers returns the proxy servers' information in a column formatted output protocol is either tcp or http and will display a different format based upon this.
func FormatReporters ¶
FormatReporters returns the reporters' info in a column formatted output.
func FormatServiceMembers ¶
func FormatServiceMembers(serviceMembers []config.ServiceMemberDetail) string
FormatServiceMembers returns the service member details in column formatted output.
func FormatServices ¶
func FormatServices(services []config.ServiceSummary) string
FormatServices returns the services' information in a column formatted output.
func FormatServicesStorage ¶
func FormatServicesStorage(services []config.ServiceStorageSummary) string
FormatServicesStorage returns the services' storage information in a column formatted output.
func FormatSnapshots ¶
FormatSnapshots returns the snapshots in a formatted output.
func FormatSubscriberChannelStats ¶
func FormatSubscriberChannelStats(channelStats []config.SubscriberChannelStats) string
FormatSubscriberChannelStats returns the subscriber channel stats in column formatted output.
func FormatSubscriberGroupChannelStats ¶
func FormatSubscriberGroupChannelStats(channelStats []config.SubscriberGroupChannelStats) string
FormatSubscriberGroupChannelStats returns the subscriber channel stats in column formatted output.
func FormatTopicsMembers ¶
func FormatTopicsMembers(topicsMembers []config.TopicsMemberDetail) string
FormatTopicsMembers returns the topics member details in column formatted output.
func FormatTopicsSubscriberGroups ¶
func FormatTopicsSubscriberGroups(subscriberGroups []config.TopicsSubscriberGroupDetail) string
FormatTopicsSubscriberGroups returns the topics subscriber groups details in column formatted output.
func FormatTopicsSubscribers ¶
func FormatTopicsSubscribers(topicsSubscribers []config.TopicsSubscriberDetail) string
FormatTopicsSubscribers returns the topics subscriber details in column formatted output
func FormatTopicsSummary ¶
func FormatTopicsSummary(topicDetails []config.TopicDetail) string
FormatTopicsSummary returns the topics summary in column formatted output.
func FormatTracing ¶
FormatTracing returns the member's tracing details in a column formatted output.
func FormatViewCacheDetail ¶
func FormatViewCacheDetail(cacheDetails []config.ViewCacheDetail) string
FormatViewCacheDetail returns the view cache details in column formatted output.
func FormatViewCacheSummary ¶
func FormatViewCacheSummary(cacheSummaries []config.ViewCacheSummaryDetail) string
FormatViewCacheSummary returns the view cache summary in column formatted output.
func GetArchivedSnapshots ¶
GetArchivedSnapshots retrieves the archived snapshots for a service.
func GetConnectionAndDataFetcher ¶
GetConnectionAndDataFetcher returns the connection and dataFetcher.
func GetConnectionNameFromContextOrArg ¶
GetConnectionNameFromContextOrArg returns the connection name from the '-c' option or the current context if set.
func GetDataFetcher ¶
GetDataFetcher returns a Fetcher given a cluster name.
func GetDistributedServices ¶
GetDistributedServices returns a list of distributed services.
func GetFederatedServices ¶
GetFederatedServices returns a list of federated services.
func GetFileName ¶
GetFileName returns a file name for the thread dump.
func GetListOfCacheServices ¶
func GetListOfCacheServices(servicesSummary config.ServicesSummaries) []string
GetListOfCacheServices returns a list of cache services.
func GetLogDirectory ¶
func GetLogDirectory() string
func GetMachineList ¶
GetMachineList returns a list of machines.
func GetNodeIds ¶
GetNodeIds returns the node ids for the current cluster.
func GetPersistenceServices ¶
GetPersistenceServices returns a list of persistence services.
func GetServices ¶
func GetServices(dataFetcher fetcher.Fetcher) (config.ServicesSummaries, error)
GetServices returns a list of services.
func GetSnapshots ¶
GetSnapshots returns the snapshots for a service.
func GetURLContents ¶
GetURLContents returns the contents at the given url as a []byte.
func Initialize ¶
Initialize initializes the command hierarchy - required for tests if command is nil then a new command is created otherwise the existing one is used.
func IssueFederationCommand ¶
func IssueFederationCommand(cmd *cobra.Command, serviceName, command, participant, mode string) error
IssueFederationCommand issues a federation command.
func IssueReporterCommand ¶
IssueReporterCommand issues a reporter command.
func ServiceExists ¶
ServiceExists returns true if a service exists.
func SetRootCommandFlags ¶
SetRootCommandFlags sets all the persistent root command flags.
func UnmarshalThreadDump ¶
UnmarshalThreadDump unmarshal a thread dump.
func WriteConfig ¶
func WriteConfig() error
WriteConfig writes the viper config and exit if there is an error.
Types ¶
type ByteArraySink ¶
ByteArraySink is a thread safe byte array.
func (*ByteArraySink) AppendByteArray ¶
func (b *ByteArraySink) AppendByteArray(bytes []byte)
AppendByteArray appends a byte array.
func (*ByteArraySink) GetByteArrays ¶
func (b *ByteArraySink) GetByteArrays() [][]byte
GetByteArrays returns the values for an GetByteArrays.
type ClusterConnection ¶
type ClusterConnection struct { Name string `json:"name"` // the name the user gives to the cluster connection DiscoveryType string `json:"discoveryType"` ConnectionType string `json:"connectionType"` // currently only valid value is "http" ConnectionURL string `json:"url"` NameServiceDiscovery string `json:"nameServiceDiscovery"` ClusterVersion string `json:"clusterVersionParam"` ClusterName string `json:"clusterName"` // the actual cluster name ClusterType string `json:"clusterType"` // the following attributes are specific to manually created clusters ManuallyCreated bool `json:"manuallyCreated"` // indicates if this was created by the create cluster command BaseClasspath string `json:"baseClasspath"` // the minimum required classes coherence.jar and coherence-json AdditionalClasspath string `json:"additionalClasspath"` // additional classpath provided by the user Arguments string `json:"arguments"` // arguments to start cluster with including cluster name, etc ManagementPort int32 `json:"managementPort"` // arguments to start cluster with including cluster name, etc PersistenceMode string `json:"persistenceMode"` LoggingDestination string `json:"loggingDestination"` // logging destination, if empty then place under ~/.cohctl/logs ManagementAvailable bool // only used when using -o wide option StartupClass string `json:"startupClass"` }
ClusterConnection describes an individual connection to a cluster.
func GetClusterConnection ¶
func GetClusterConnection(connectionName string) (bool, ClusterConnection)
GetClusterConnection returns the URL for a given a cluster connection name.
type CoherenceCLIConfig ¶
type CoherenceCLIConfig struct { Version string `json:"version"` CurrentContext string `json:"currentContext"` Clusters []ClusterConnection `mapstructure:"clusters"` Debug bool `json:"debug"` Color string `json:"color"` RequestTimeout int32 `json:"requestTimeout"` IgnoreInvalidCerts bool `json:"ignoreInvalidCerts"` DefaultBytesFormat string `json:"defaultBytesFormat"` DefaultHeap string `json:"defaultHeap"` UseGradle bool `json:"useGradle"` Profiles []ProfileValue `mapstructure:"profiles"` }
CoherenceCLIConfig describes the details stored in the .cohctl.yaml.
type ErrorSink ¶
ErrorSink holds errors from multiple go routines.
func (*ErrorSink) AppendError ¶
AppendError appends an error.
type FormattedTable ¶
type FormattedTable interface { WithAlignment(...string) FormattedTable WithHeader(...string) FormattedTable MaxLength(int) FormattedTable AddColumnsToRow(...string) AddHeaderColumns(...string) AddRow(...string) AddFormattingFunction(int, formatter) String() string }
FormattedTable defines a formatted table of information.
type ProfileValue ¶
ProfileValue describes a profile to be used for creating and starting clusters.
Source Files ¶
- add.go
- archive.go
- bytes_format.go
- cache.go
- clear.go
- cluster.go
- cluster_utils.go
- color.go
- compact.go
- completions.go
- config.go
- configure.go
- connect.go
- context.go
- create.go
- debug.go
- default_heap.go
- describe.go
- disconnect.go
- discover.go
- dump.go
- elastic_data.go
- environment.go
- executor.go
- federation.go
- formatting.go
- formatting_functions.go
- get.go
- health.go
- http_server.go
- http_session.go
- ingore_certs.go
- jfr.go
- log.go
- logs.go
- machine.go
- management.go
- member.go
- monitor.go
- notify.go
- nslookup.go
- pause.go
- persistence.go
- proc_other.go
- profile.go
- proxy.go
- recover.go
- remove.go
- replicate.go
- reporter.go
- reset_stats.go
- resume.go
- retrieve.go
- root.go
- scale.go
- service.go
- set.go
- shutdown.go
- snapshot.go
- start.go
- stop.go
- suspend.go
- timeout.go
- topics.go
- truncate.go
- use-gradle.go
- utils.go
- version.go