Documentation ¶
Index ¶
- Constants
- Variables
- func AppendCredentials(path, appLocation string, payload []byte) ([]byte, error)
- func AppendLangCompat(path, appLocation string, payload []byte) ([]byte, error)
- func Assert(stmt func() bool)
- func BreakpadOn() bool
- func BucketSeqnos(cluster, pooln, bucketn string) (l_seqnos []uint64, err error)
- func CPUCount(log bool) int
- func CheckAndGetBktAndScopeIDs(fG *common.FunctionScope, restPort string) (string, uint32, error)
- func CheckBucketExist(bucket, hostaddress string) bool
- func CheckIfAppBootstrapOngoing(urlSuffix string, nodeAddrs []string, query string) (bool, error)
- func CheckIfBootstrapOngoing(urlSuffix string, nodeAddrs []string) (bool, error)
- func CheckIfRebalanceOngoing(urlSuffix string, nodeAddrs []string) (bool, error)
- func CheckTLSandReplaceProtocol(connStr string, args ...interface{}) string
- func ClusterUrl(cluster string) (string, error)
- func CollectSeqnos(kvfeeds map[string]*kvConn, bucketLevel bool, cid uint32) (l_seqnos []uint64, err error)
- func CollectionAware(hostaddress string) (bool, error)
- func CompareSlices(s1, s2 []uint16) bool
- func CompareStringSlices(s1, s2 []string) bool
- func ComposeOBOAuthInfo(user, domain string) (oboAuthInfo string)
- func ComputeMD5(data []byte) ([]byte, error)
- func Condense(vbs []uint16) string
- func ConnectBucket(cluster, pooln, bucketn string) (*couchbase.Bucket, uint32, error)
- func Console(clusterAddr string, format string, v ...interface{}) error
- func Contains(needle interface{}, haystack interface{}) bool
- func ContainsIgnoreCase(needle string, haystack []string) bool
- func ConvertBigEndianToUint64(cas []byte) (uint64, error)
- func CountActiveKVNodes(bucket, hostaddress string) int
- func CurrentEventingNodeAddress(hostaddress string) (string, error)
- func DeepCopy(kv map[string]interface{}) (newKv map[string]interface{})
- func DeleteAppContent(appPath, checksumPath, appLocation string) error
- func DeleteStaleAppContent(appPath, appLocation string) error
- func Do(req *http.Request) (*http.Response, error)
- func EncodeAppPayload(app *cm.Application) []byte
- func EventingNodesAddresses(hostaddress string) ([]string, error)
- func EventingVer() string
- func FloatEquals(a, b float64) bool
- func GenerateFunctionID() (uint32, error)
- func GenerateFunctionInstanceID() (string, error)
- func GenerateRandomNameSuffix() string
- func Get(url string) (resp *http.Response, err error)
- func GetAggBootstrapAppStatus(nodeAddr string, query string, isLocalhost bool) (bool, error)
- func GetAggBootstrapStatus(nodeAddr string) (bool, error)
- func GetAggBootstrappingApps(urlSuffix string, nodeAddrs []string) (bool, error)
- func GetAggPausingApps(urlSuffix string, nodeAddrs []string) (bool, error)
- func GetAppNameFromPath(path string) (string, error)
- func GetAppStatus(urlSuffix string, nodeAddrs []string) (map[string]map[string]string, error)
- func GetCluster(caller, connstr string, s common.EventingSuperSup) (*gocb.Cluster, error)
- func GetConnectionStr(kvVBMap map[uint16]string) string
- func GetEventProcessingStats(urlSuffix string, nodeAddrs []string) (map[string]int64, error)
- func GetEventingVersion(urlSuffix string, nodeAddrs []string) ([]string, error)
- func GetFunctionInstanceId(funcId uint32, funcInstanceId string) string
- func GetHash(appCode string) string
- func GetIPMode() string
- func GetLogLevel(logLevel string) logging.LogLevel
- func GetNetworkProtocol() string
- func GetNodeUUIDs(urlSuffix string, nodeAddrs []string) (map[string]string, error)
- func GetProgress(urlSuffix string, nodeAddrs []string) (*cm.RebalanceProgress, map[string]interface{}, map[string]error)
- func GetRestPort() string
- func GetSecurityConfig() *common.SecuritySetting
- func GetSeqnos(args ...interface{}) error
- func GetSystemEventInfo(eventId systemeventlog.EventId) (systemeventlog.SystemEventInfo, error)
- func Head(url string) (resp *http.Response, err error)
- func HexLittleEndianToUint64(hexLE []byte) (uint64, error)
- func IgnorePurgeSeqFlagAvailable(hostaddress string) (bool, error)
- func InitialiseSystemEventLogger(restPort string)
- func IsIPv6() bool
- func KVNodesAddresses(hostaddress, bucket string) ([]string, error)
- func KVVbMap(bucket, hostaddress string) (map[uint16]string, error)
- func KillProcess(pid int) error
- func ListChildren(path string) ([]string, error)
- func LocalEventingServiceHost(hostaddress string) (string, error)
- func LocalKey() (usr, key string)
- func Localhost() string
- func LogSystemEvent(eventId systemeventlog.EventId, severity systemeventlog.EventSeverity, ...)
- func MaxFunctionSize() int
- func MaybeCompress(payload []byte, compressPayload bool) ([]byte, error)
- func MaybeDecompress(payload []byte) ([]byte, error)
- func MemcachedErrCode(err error) gomemcached.Status
- func MetaKvDelete(path string, rev interface{}) error
- func MetaKvMaxDocSize() int
- func MetakvGet(path string) ([]byte, error)
- func MetakvRecursiveDelete(dirpath string) error
- func MetakvSet(path string, value []byte, rev interface{}) error
- func MetakvSetSensitive(path string, value []byte, rev interface{}) error
- func NewRequest(method, url string, body io.Reader) (*http.Request, error)
- func NsServerNodesAddresses(hostaddress string) ([]string, error)
- func ParseFunctionPayload(data []byte, fnName string) cm.Application
- func Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
- func PostForm(url string, data url.Values) (resp *http.Response, err error)
- func ReadAppContent(appsPath, checksumPath, appLocation string) ([]byte, error)
- func ResetStatsCounters(urlSuffix string, nodeAddrs []string) ([]byte, error)
- func Retry(b Backoff, retryCount *int64, callback CallbackFunc, args ...interface{}) error
- func RoundUpToNearestPowerOf2(number float64) int
- func ScopeOrCollectionSeqnos(cluster, pooln, bucketn string, id uint32) (l_seqnos []uint64, locationFound bool, err error)
- func SeedProcess()
- func SetBreakpad(val bool)
- func SetDcpMemcachedTimeout(val uint32)
- func SetIPFlags(ipv6Flag, ipv4Flag string)
- func SetMaxFunctionSize(size int)
- func SetMetaKvMaxDocSize(size int)
- func SetRestPort(flagRestPort string)
- func SetSecurityConfig(config *common.SecuritySetting)
- func SetServicePorts(portMap map[string]string)
- func SetUseTLS(value bool)
- func SprintDCPCounts(counts map[mcd.CommandCode]uint64) (string, uint64, time.Time)
- func SprintV8Counts(counts map[string]uint64) string
- func StopDebugger(nodeAddr, appLocation string)
- func StrSliceDiff(kv1, kv2 []string) []string
- func StripCurlCredentials(path, appLocation string, payload []byte) ([]byte, error)
- func StripScheme(endpoint string) string
- func SuperImpose(source, on map[string]interface{}) map[string]interface{}
- func ToStr(value bool) (strValue string)
- func ToStringArray(from interface{}) (to []string)
- func Uint16SliceDiff(kv1, kv2 []uint16) []uint16
- func ValidateAndCheckKeyspaceExist(bucket, scope, collection, hostaddress string, wildcardAllowed bool) error
- func VbsSliceDiff(X, Y []uint16) []uint16
- func VbucketByKey(key []byte, numVbuckets int) uint16
- func VbucketDistribution(vbs []uint16, numWorkers int) map[int][]uint16
- func VbucketNodeAssignment(vbs []uint16, numWorkers int) map[int][]uint16
- func WriteAppContent(appsPath, checksumPath, appLocation string, payload []byte, ...) error
- type Backoff
- type BoundedQueue
- type CallbackFunc
- type CbAuthHandler
- type Client
- func (c *Client) Delete(url string) (resp *http.Response, err error)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) Get(url string) (resp *http.Response, err error)
- func (c *Client) Head(url string) (resp *http.Response, err error)
- func (c *Client) Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
- func (c *Client) PostForm(url string, data url.Values) (resp *http.Response, err error)
- type Clock
- type ClusterInfoCache
- func (c *ClusterInfoCache) Fetch(np *couchbase.Pool) error
- func (c *ClusterInfoCache) FetchManifestInfo(bucketName string) error
- func (c *ClusterInfoCache) FetchWithLock(np *couchbase.Pool) error
- func (c *ClusterInfoCache) GetActiveEventingNodes() (nodes []couchbase.Node)
- func (c *ClusterInfoCache) GetAddressOfActiveKVNodes() (addresses []string, err error)
- func (c *ClusterInfoCache) GetAllNodes() []*Node
- func (c *ClusterInfoCache) GetBucketUUID(bucket string) (uuid string)
- func (c *ClusterInfoCache) GetBuckets() []string
- func (c *ClusterInfoCache) GetClusterVersion() (int, int)
- func (c *ClusterInfoCache) GetCollectionID(bucket, scope, collection string) (uint32, error)
- func (c *ClusterInfoCache) GetCollectionManifest(bucketName string) *collections.CollectionManifest
- func (c *ClusterInfoCache) GetCurrentNode() NodeId
- func (c *ClusterInfoCache) GetExternalIPOfThisNode(hostnames []string) (string, error)
- func (c *ClusterInfoCache) GetFailedEventingNodes() (nodes []couchbase.Node)
- func (c *ClusterInfoCache) GetLocalHostAddress() (string, error)
- func (c *ClusterInfoCache) GetLocalHostname() (string, error)
- func (c *ClusterInfoCache) GetLocalServiceAddress(srvc string) (string, error)
- func (c *ClusterInfoCache) GetLocalServiceHost(srvc string) (string, error)
- func (c *ClusterInfoCache) GetLocalServicePort(srvc string) (string, error)
- func (c *ClusterInfoCache) GetManifestID(bucket string) (string, error)
- func (c *ClusterInfoCache) GetNewEventingNodes() (nodes []couchbase.Node)
- func (c *ClusterInfoCache) GetNodeCompatVersion() (uint32, uint32)
- func (c *ClusterInfoCache) GetNodeStatus(nid NodeId) (string, error)
- func (c *ClusterInfoCache) GetNodesByBucket(bucket string) (nids []NodeId, err error)
- func (c *ClusterInfoCache) GetNodesByServiceType(srvc string) (nids []NodeId)
- func (c *ClusterInfoCache) GetNumVbucketsForBucket(bucketName string) int
- func (c *ClusterInfoCache) GetScopes(bucketName string) map[string][]string
- func (c *ClusterInfoCache) GetServiceAddress(nid NodeId, srvc string) (addr string, err error)
- func (c *ClusterInfoCache) GetUniqueBSCIds(bucket, scope, collection string) (string, uint32, uint32, error)
- func (c *ClusterInfoCache) GetVBuckets(nid NodeId, bucket string) (vbs []uint32, err error)
- func (c *ClusterInfoCache) IsEphemeral(bucket string) (bool, error)
- func (c *ClusterInfoCache) IsMemcached(bucket string) (bool, error)
- func (c *ClusterInfoCache) IsNodeHealthy(nid NodeId) (bool, error)
- func (c *ClusterInfoCache) SetLogPrefix(p string)
- func (c *ClusterInfoCache) SetMaxRetries(r int)
- func (c *ClusterInfoCache) SetServicePorts(portMap map[string]string)
- func (c *ClusterInfoCache) StorageEngine(bucketName string) (common.StorageEngine, error)
- type ClusterInfoClient
- type Config
- type ConfigHolder
- type DynamicAuthenticator
- func (dynAuth *DynamicAuthenticator) Certificate(req gocb.AuthCertRequest) (*tls.Certificate, error)
- func (dynAuth *DynamicAuthenticator) Credentials(req gocb.AuthCredsRequest) ([]gocb.UserPassPair, error)
- func (dynAuth *DynamicAuthenticator) SupportsNonTLS() bool
- func (dynAuth *DynamicAuthenticator) SupportsTLS() bool
- type Element
- type ExponentialBackoff
- type FixedBackoff
- type GocbLogger
- type Node
- type NodeId
- type Notification
- type NotificationType
- type PayloadHash
- type RetryHelper
- type ServicesChangeNotifier
- func (sn *ServicesChangeNotifier) Close()
- func (sn *ServicesChangeNotifier) GarbageCollect(bucketlist map[string]struct{})
- func (sn *ServicesChangeNotifier) Get() (n Notification, err error)
- func (sn *ServicesChangeNotifier) GetNotifyCh() chan Notification
- func (sn *ServicesChangeNotifier) RunObserveCollectionManifestChanges(bucketName string)
- func (sn *ServicesChangeNotifier) StopObserveCollectionManifestChanges(bucketName string)
- type Stack
- type Stats
- type UUID
- type Uint16Slice
Constants ¶
const ( EVENTING_ADMIN_SERVICE = "eventingAdminPort" EVENTING_SSL_SERVICE = "eventingSSL" )
const ( SYSTEM_EVENT_COMPONENT = "eventing" SUB_COMPONENT_EVENTING_PRODUCER = "eventing-producer" DEFAULT_TIMEOUT_SECS = 2 )
const ( EVENTID_PRODUCER_STARTUP systemeventlog.EventId = 4096 EVENTID_CONSUMER_STARTUP systemeventlog.EventId = 4097 EVENTID_CONSUMER_CRASH systemeventlog.EventId = 4098 EVENTID_START_TRACING systemeventlog.EventId = 4099 EVENTID_STOP_TRACING systemeventlog.EventId = 4100 EVENTID_START_DEBUGGER systemeventlog.EventId = 4101 EVENTID_STOP_DEBUGGER systemeventlog.EventId = 4102 EVENTID_CREATE_FUNCTION systemeventlog.EventId = 4103 EVENTID_DELETE_FUNCTION systemeventlog.EventId = 4104 EVENTID_IMPORT_FUNCTIONS systemeventlog.EventId = 4105 EVENTID_EXPORT_FUNCTIONS systemeventlog.EventId = 4106 EVENTID_BACKUP_FUNCTION systemeventlog.EventId = 4107 EVENTID_RESTORE_FUNCTION systemeventlog.EventId = 4108 EVENTID_DEPLOY_FUNCTION systemeventlog.EventId = 4109 EVENTID_UNDEPLOY_FUNCTION systemeventlog.EventId = 4110 EVENTID_PAUSE_FUNCTION systemeventlog.EventId = 4111 EVENTID_RESUME_FUNCTION systemeventlog.EventId = 4112 EVENTID_CLEANUP_EVENTING systemeventlog.EventId = 4113 EVENTID_DIE systemeventlog.EventId = 4114 EVENTID_TRIGGER_GC systemeventlog.EventId = 4115 EVENTID_FREE_OS_MEMORY systemeventlog.EventId = 4116 EVENTID_UPDATE_CONFIG systemeventlog.EventId = 4117 EVENTID_CLEAR_STATISTICS systemeventlog.EventId = 4118 )
const ( Stop time.Duration = -1 DefaultInitialInterval = 1 * time.Second DefaultRandomizationFactor = 0.5 DefaultMultiplier = 1.5 DefaultMaxInterval = 10 * time.Second DefaultMaxElapsedTime = time.Minute )
const ( EventingAdminService = "eventingAdminPort" EventingAdminSSL = "eventingSSL" DataService = "kv" DataServiceSSL = "kvSSL" MgmtService = "mgmt" MgmtServiceSSL = "mgmtSSL" EPSILON = 1e-5 )
const BUCKET_UUID_NIL = ""
const CLUSTER_INFO_INIT_RETRIES = 5
const CLUSTER_INFO_VALIDATION_RETRIES = 10
const CLUSTER_VERSION_7 uint32 = 7
const (
MAX_AUTH_RETRIES = 10
)
const OBOAuthHeader = "cb-on-behalf-of"
Variables ¶
var ( ErrInvalidNodeId = errors.New("Invalid NodeId") ErrInvalidService = errors.New("Invalid service") ErrNodeNotBucketMember = errors.New("Node is not a member of bucket") ErrValidationFailed = errors.New("ClusterInfo Validation Failed") )
var ( ErrNodeServicesConnect = errors.New("Internal services API connection closed") ErrNodeServicesCancel = errors.New("Cancelled services change notifier") ErrNotifierInvalid = errors.New("Notifier invalidated due to internal error") )
var ( CrcTable *crc32.Table TCP_REQ = "required" TCP_OPT = "optional" TCP_OFF = "off" HTTPRequestTimeout = 10 * time.Second )
var AppNotExist = errors.New("App content doesn't exist or is empty")
var DefaultClient = &Client{}
var ErrWildcardNotAllowed = errors.New("Wildcard not allowed")
var ErrorClosed = errors.New("bounded_queue is closed")
var ErrorSize = errors.New("element size is more than max memory quota")
var GocbCredsRequestCounter = 0
var ServiceAddrMap map[string]string
var SingletonServicesContainer struct { sync.Mutex Notifiers map[string]*serviceNotifierInstance }
Implements nodeServices change notifier system
var SystemClock = systemClock{}
Functions ¶
func AppendCredentials ¶
func AppendLangCompat ¶
func BreakpadOn ¶
func BreakpadOn() bool
func BucketSeqnos ¶
BucketSeqnos return list of {{vbno,seqno}..} for all vbuckets. this call might fail due to,
- concurrent access that can preserve a deleted/failed bucket object.
- pollForDeletedBuckets() did not get a chance to cleanup a deleted bucket.
in both the cases if the call is retried it should get fixed, provided a valid bucket exists.
func CheckBucketExist ¶
func CheckIfBootstrapOngoing ¶
func CheckIfRebalanceOngoing ¶
func ClusterUrl ¶
func CollectSeqnos ¶
func CollectionAware ¶
func CompareSlices ¶
func CompareStringSlices ¶
func ComposeOBOAuthInfo ¶
func ComputeMD5 ¶
func ConnectBucket ¶
ConnectBucket will instantiate a couchbase-bucket instance with cluster. caller's responsibility to close the bucket. It also returns clusterVersion
func ContainsIgnoreCase ¶
func CountActiveKVNodes ¶
func DeleteAppContent ¶
DeleteAppContent delete handler code
func DeleteStaleAppContent ¶
Delete stale app fragments
func EncodeAppPayload ¶
func EncodeAppPayload(app *cm.Application) []byte
func EventingNodesAddresses ¶
func EventingVer ¶
func EventingVer() string
func FloatEquals ¶
func GenerateFunctionID ¶
func GenerateRandomNameSuffix ¶
func GenerateRandomNameSuffix() string
func GetAggBootstrapStatus ¶
func GetAggBootstrappingApps ¶
func GetAppNameFromPath ¶
func GetAppStatus ¶
func GetCluster ¶
func GetCluster(caller, connstr string, s common.EventingSuperSup) (*gocb.Cluster, error)
func GetConnectionStr ¶
func GetEventProcessingStats ¶
func GetEventingVersion ¶
func GetFunctionInstanceId ¶
func GetLogLevel ¶
func GetNetworkProtocol ¶
func GetNetworkProtocol() string
func GetNodeUUIDs ¶
func GetProgress ¶
func GetRestPort ¶
func GetRestPort() string
func GetSecurityConfig ¶
func GetSecurityConfig() *common.SecuritySetting
func GetSystemEventInfo ¶
func GetSystemEventInfo(eventId systemeventlog.EventId) (systemeventlog.SystemEventInfo, error)
func HexLittleEndianToUint64 ¶
func InitialiseSystemEventLogger ¶
func InitialiseSystemEventLogger(restPort string)
func KVNodesAddresses ¶
func KillProcess ¶
func ListChildren ¶
func LogSystemEvent ¶
func LogSystemEvent(eventId systemeventlog.EventId, severity systemeventlog.EventSeverity, extraAttributes interface{})
func MaxFunctionSize ¶
func MaxFunctionSize() int
func MaybeDecompress ¶
func MemcachedErrCode ¶
func MemcachedErrCode(err error) gomemcached.Status
func MetaKvDelete ¶
func MetaKvMaxDocSize ¶
func MetaKvMaxDocSize() int
func MetakvRecursiveDelete ¶
func MetakvSetSensitive ¶
func NsServerNodesAddresses ¶
func ParseFunctionPayload ¶
func ParseFunctionPayload(data []byte, fnName string) cm.Application
func ReadAppContent ¶
ReadAppContent reads function code
func ResetStatsCounters ¶
func Retry ¶
func Retry(b Backoff, retryCount *int64, callback CallbackFunc, args ...interface{}) error
func ScopeOrCollectionSeqnos ¶
func SeedProcess ¶
func SeedProcess()
func SetBreakpad ¶
func SetBreakpad(val bool)
func SetDcpMemcachedTimeout ¶
func SetDcpMemcachedTimeout(val uint32)
func SetIPFlags ¶
func SetIPFlags(ipv6Flag, ipv4Flag string)
func SetMaxFunctionSize ¶
func SetMaxFunctionSize(size int)
func SetMetaKvMaxDocSize ¶
func SetMetaKvMaxDocSize(size int)
func SetSecurityConfig ¶
func SetSecurityConfig(config *common.SecuritySetting)
func SetServicePorts ¶
func SprintDCPCounts ¶
func SprintV8Counts ¶
func StopDebugger ¶
func StopDebugger(nodeAddr, appLocation string)
func StrSliceDiff ¶
func StripCurlCredentials ¶
func StripScheme ¶
func SuperImpose ¶
func ToStringArray ¶
func ToStringArray(from interface{}) (to []string)
func Uint16SliceDiff ¶
func ValidateAndCheckKeyspaceExist ¶
func ValidateAndCheckKeyspaceExist(bucket, scope, collection, hostaddress string, wildcardAllowed bool) error
empty scope and collection argument will check for bucket existence
func VbsSliceDiff ¶
func VbucketByKey ¶
VbucketByKey returns doc_id to vbucket mapping
func VbucketDistribution ¶
VbucketDistribution is used by vbucket ownership give up and takeover routines during rebalance
func VbucketNodeAssignment ¶
VbucketNodeAssignment will be used as generic partitioning scheme for vbucket assignment to Eventing.Consumer and Eventing.Producer instances
Types ¶
type BoundedQueue ¶
type BoundedQueue struct {
// contains filtered or unexported fields
}
func NewBoundedQueue ¶
func NewBoundedQueue(maxcount, maxsize uint64) *BoundedQueue
func (*BoundedQueue) Close ¶
func (q *BoundedQueue) Close()
func (*BoundedQueue) Count ¶
func (q *BoundedQueue) Count() uint64
func (*BoundedQueue) IsClosed ¶
func (q *BoundedQueue) IsClosed() bool
func (*BoundedQueue) Pop ¶
func (q *BoundedQueue) Pop() (Element, error)
func (*BoundedQueue) Push ¶
func (q *BoundedQueue) Push(elem Element) error
type CallbackFunc ¶
type CallbackFunc func(arg ...interface{}) error
type CbAuthHandler ¶
cbauth admin authentication helper Uses default cbauth env variables internally to provide auth creds
func (*CbAuthHandler) AuthenticateMemcachedConn ¶
func (ah *CbAuthHandler) AuthenticateMemcachedConn(host string, conn *memcached.Client) error
func (*CbAuthHandler) GetCredentials ¶
func (ah *CbAuthHandler) GetCredentials() (string, string)
type Client ¶
func CheckTLSandGetClient ¶
func NewTLSClient ¶
func NewTLSClient(timeout time.Duration, config *common.SecuritySetting) *Client
type ClusterInfoCache ¶
Helper object for fetching cluster information Can be used by services running on a cluster node to connect with local management service for obtaining cluster information. Info cache can be updated by using Refresh() method.
func FetchNewClusterInfoCache ¶
func FetchNewClusterInfoCache(clusterUrl string) (*ClusterInfoCache, error)
func (*ClusterInfoCache) FetchManifestInfo ¶
func (c *ClusterInfoCache) FetchManifestInfo(bucketName string) error
func (*ClusterInfoCache) FetchWithLock ¶
func (c *ClusterInfoCache) FetchWithLock(np *couchbase.Pool) error
func (*ClusterInfoCache) GetActiveEventingNodes ¶
func (c *ClusterInfoCache) GetActiveEventingNodes() (nodes []couchbase.Node)
func (*ClusterInfoCache) GetAddressOfActiveKVNodes ¶
func (c *ClusterInfoCache) GetAddressOfActiveKVNodes() (addresses []string, err error)
func (*ClusterInfoCache) GetAllNodes ¶
func (c *ClusterInfoCache) GetAllNodes() []*Node
func (*ClusterInfoCache) GetBucketUUID ¶
func (c *ClusterInfoCache) GetBucketUUID(bucket string) (uuid string)
Return UUID of a given bucket.
func (*ClusterInfoCache) GetBuckets ¶
func (c *ClusterInfoCache) GetBuckets() []string
func (*ClusterInfoCache) GetClusterVersion ¶
func (c *ClusterInfoCache) GetClusterVersion() (int, int)
func (*ClusterInfoCache) GetCollectionID ¶
func (c *ClusterInfoCache) GetCollectionID(bucket, scope, collection string) (uint32, error)
func (*ClusterInfoCache) GetCollectionManifest ¶
func (c *ClusterInfoCache) GetCollectionManifest(bucketName string) *collections.CollectionManifest
func (*ClusterInfoCache) GetCurrentNode ¶
func (c *ClusterInfoCache) GetCurrentNode() NodeId
func (*ClusterInfoCache) GetExternalIPOfThisNode ¶
func (c *ClusterInfoCache) GetExternalIPOfThisNode(hostnames []string) (string, error)
func (*ClusterInfoCache) GetFailedEventingNodes ¶
func (c *ClusterInfoCache) GetFailedEventingNodes() (nodes []couchbase.Node)
func (*ClusterInfoCache) GetLocalHostAddress ¶
func (c *ClusterInfoCache) GetLocalHostAddress() (string, error)
func (*ClusterInfoCache) GetLocalHostname ¶
func (c *ClusterInfoCache) GetLocalHostname() (string, error)
func (*ClusterInfoCache) GetLocalServiceAddress ¶
func (c *ClusterInfoCache) GetLocalServiceAddress(srvc string) (string, error)
func (*ClusterInfoCache) GetLocalServiceHost ¶
func (c *ClusterInfoCache) GetLocalServiceHost(srvc string) (string, error)
func (*ClusterInfoCache) GetLocalServicePort ¶
func (c *ClusterInfoCache) GetLocalServicePort(srvc string) (string, error)
func (*ClusterInfoCache) GetManifestID ¶
func (c *ClusterInfoCache) GetManifestID(bucket string) (string, error)
func (*ClusterInfoCache) GetNewEventingNodes ¶
func (c *ClusterInfoCache) GetNewEventingNodes() (nodes []couchbase.Node)
func (*ClusterInfoCache) GetNodeCompatVersion ¶
func (c *ClusterInfoCache) GetNodeCompatVersion() (uint32, uint32)
func (*ClusterInfoCache) GetNodeStatus ¶
func (c *ClusterInfoCache) GetNodeStatus(nid NodeId) (string, error)
func (*ClusterInfoCache) GetNodesByBucket ¶
func (c *ClusterInfoCache) GetNodesByBucket(bucket string) (nids []NodeId, err error)
func (*ClusterInfoCache) GetNodesByServiceType ¶
func (c *ClusterInfoCache) GetNodesByServiceType(srvc string) (nids []NodeId)
func (*ClusterInfoCache) GetNumVbucketsForBucket ¶
func (c *ClusterInfoCache) GetNumVbucketsForBucket(bucketName string) int
func (*ClusterInfoCache) GetScopes ¶
func (c *ClusterInfoCache) GetScopes(bucketName string) map[string][]string
func (*ClusterInfoCache) GetServiceAddress ¶
func (c *ClusterInfoCache) GetServiceAddress(nid NodeId, srvc string) (addr string, err error)
func (*ClusterInfoCache) GetUniqueBSCIds ¶
func (*ClusterInfoCache) GetVBuckets ¶
func (c *ClusterInfoCache) GetVBuckets(nid NodeId, bucket string) (vbs []uint32, err error)
func (*ClusterInfoCache) IsEphemeral ¶
func (c *ClusterInfoCache) IsEphemeral(bucket string) (bool, error)
func (*ClusterInfoCache) IsMemcached ¶
func (c *ClusterInfoCache) IsMemcached(bucket string) (bool, error)
func (*ClusterInfoCache) IsNodeHealthy ¶
func (c *ClusterInfoCache) IsNodeHealthy(nid NodeId) (bool, error)
func (*ClusterInfoCache) SetLogPrefix ¶
func (c *ClusterInfoCache) SetLogPrefix(p string)
func (*ClusterInfoCache) SetMaxRetries ¶
func (c *ClusterInfoCache) SetMaxRetries(r int)
func (*ClusterInfoCache) SetServicePorts ¶
func (c *ClusterInfoCache) SetServicePorts(portMap map[string]string)
func (*ClusterInfoCache) StorageEngine ¶
func (c *ClusterInfoCache) StorageEngine(bucketName string) (common.StorageEngine, error)
type ClusterInfoClient ¶
type ClusterInfoClient struct {
// contains filtered or unexported fields
}
func FetchClusterInfoClient ¶
func FetchClusterInfoClient(clusterURL string) (c *ClusterInfoClient, err error)
func (*ClusterInfoClient) Close ¶
func (c *ClusterInfoClient) Close()
func (*ClusterInfoClient) GetClusterInfoCache ¶
func (c *ClusterInfoClient) GetClusterInfoCache() *ClusterInfoCache
Consumer must lock returned cinfo before using it
type ConfigHolder ¶
type ConfigHolder struct {
// contains filtered or unexported fields
}
func (*ConfigHolder) Load ¶
func (h *ConfigHolder) Load() Config
func (*ConfigHolder) Store ¶
func (h *ConfigHolder) Store(conf Config)
type DynamicAuthenticator ¶
type DynamicAuthenticator struct {
Caller string
}
func (*DynamicAuthenticator) Certificate ¶
func (dynAuth *DynamicAuthenticator) Certificate(req gocb.AuthCertRequest) (*tls.Certificate, error)
func (*DynamicAuthenticator) Credentials ¶
func (dynAuth *DynamicAuthenticator) Credentials(req gocb.AuthCredsRequest) ([]gocb.UserPassPair, error)
func (*DynamicAuthenticator) SupportsNonTLS ¶
func (dynAuth *DynamicAuthenticator) SupportsNonTLS() bool
func (*DynamicAuthenticator) SupportsTLS ¶
func (dynAuth *DynamicAuthenticator) SupportsTLS() bool
type ExponentialBackoff ¶
type ExponentialBackoff struct { InitialInterval time.Duration RandomizationFactor float64 Multiplier float64 MaxInterval time.Duration // After MaxElapsedTime the ExponentialBackoff stops. // It never stops if MaxElapsedTime == 0. MaxElapsedTime time.Duration Clock Clock // contains filtered or unexported fields }
func NewExponentialBackoff ¶
func NewExponentialBackoff() *ExponentialBackoff
func (*ExponentialBackoff) GetElapsedTime ¶
func (b *ExponentialBackoff) GetElapsedTime() time.Duration
func (*ExponentialBackoff) NextBackoff ¶
func (b *ExponentialBackoff) NextBackoff() time.Duration
func (*ExponentialBackoff) Reset ¶
func (b *ExponentialBackoff) Reset()
type FixedBackoff ¶
func NewFixedBackoff ¶
func NewFixedBackoff(d time.Duration) *FixedBackoff
func (*FixedBackoff) NextBackoff ¶
func (b *FixedBackoff) NextBackoff() time.Duration
func (*FixedBackoff) Reset ¶
func (b *FixedBackoff) Reset()
type GocbLogger ¶
type GocbLogger struct{}
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func NewNodeWithScheme ¶
func (Node) HasLoopbackAddress ¶
type Notification ¶
type Notification struct { Type NotificationType Msg interface{} }
func (Notification) String ¶
func (n Notification) String() string
type NotificationType ¶
type NotificationType int
const ( ServiceChangeNotification NotificationType = iota PoolChangeNotification CollectionManifestChangeNotification EncryptionLevelChangeNotification )
type PayloadHash ¶
type RetryHelper ¶
type RetryHelper struct {
// contains filtered or unexported fields
}
Helper object to execute a function with retries and exponential backoff
func NewRetryHelper ¶
func NewRetryHelper( maxRetries int, interval time.Duration, factor int, call retryFunc) *RetryHelper
func (*RetryHelper) Run ¶
func (r *RetryHelper) Run() error
type ServicesChangeNotifier ¶
type ServicesChangeNotifier struct {
// contains filtered or unexported fields
}
func NewServicesChangeNotifier ¶
func NewServicesChangeNotifier(clusterUrl, pool string) (*ServicesChangeNotifier, error)
Initialize change notifier object for a clusterUrl
func (*ServicesChangeNotifier) Close ¶
func (sn *ServicesChangeNotifier) Close()
Consumer can cancel and invalidate notifier object by calling Close()
func (*ServicesChangeNotifier) GarbageCollect ¶
func (sn *ServicesChangeNotifier) GarbageCollect(bucketlist map[string]struct{})
func (*ServicesChangeNotifier) Get ¶
func (sn *ServicesChangeNotifier) Get() (n Notification, err error)
Call Get() method to block wait and obtain next services Config
func (*ServicesChangeNotifier) GetNotifyCh ¶
func (sn *ServicesChangeNotifier) GetNotifyCh() chan Notification
func (*ServicesChangeNotifier) RunObserveCollectionManifestChanges ¶
func (sn *ServicesChangeNotifier) RunObserveCollectionManifestChanges(bucketName string)
func (*ServicesChangeNotifier) StopObserveCollectionManifestChanges ¶
func (sn *ServicesChangeNotifier) StopObserveCollectionManifestChanges(bucketName string)
type Uint16Slice ¶
type Uint16Slice []uint16
func (Uint16Slice) Len ¶
func (s Uint16Slice) Len() int
func (Uint16Slice) Less ¶
func (s Uint16Slice) Less(i, j int) bool
func (Uint16Slice) Swap ¶
func (s Uint16Slice) Swap(i, j int)