From 3d3b6ec41f9db32bd9e109ae37836d7f3e7dc450 Mon Sep 17 00:00:00 2001 From: vsharma6855 Date: Tue, 19 Nov 2024 21:11:28 +0530 Subject: [PATCH] Doctl Changes for MySQL Log Output and other missing configs (#1613) * Doctl Changes for MySQL Log Output and other missing configs * change tab to space * change tab to space * fix indentation for whole file * convert tab to whitespace * change the value of timescaledb * changed max_failover_replication_time_lag * Merge branch 'main' into feature/add-database-missing-configs * changed max_failover_replication_time_lag * removed timescaledb --------- Co-authored-by: v.sharma --- commands/displayers/database.go | 62 ++++ go.mod | 6 +- go.sum | 12 +- integration/database_config_get_test.go | 289 ++++++++++-------- .../github.com/digitalocean/godo/CHANGELOG.md | 5 + vendor/github.com/digitalocean/godo/godo.go | 2 +- vendor/golang.org/x/oauth2/README.md | 15 +- vendor/golang.org/x/time/rate/rate.go | 17 +- vendor/modules.txt | 6 +- 9 files changed, 244 insertions(+), 170 deletions(-) diff --git a/commands/displayers/database.go b/commands/displayers/database.go index 169d8a47c..604e33a40 100644 --- a/commands/displayers/database.go +++ b/commands/displayers/database.go @@ -1191,6 +1191,48 @@ func (dc *MySQLConfiguration) KV() []map[string]any { "value": *c.BinlogRetentionPeriod, }) } + if c.InnodbChangeBufferMaxSize != nil { + o = append(o, map[string]any{ + "key": "InnodbChangeBufferMaxSize", + "value": *c.InnodbChangeBufferMaxSize, + }) + } + if c.InnodbFlushNeighbors != nil { + o = append(o, map[string]any{ + "key": "InnodbFlushNeighbors", + "value": *c.InnodbFlushNeighbors, + }) + } + if c.InnodbReadIoThreads != nil { + o = append(o, map[string]any{ + "key": "InnodbReadIoThreads", + "value": *c.InnodbReadIoThreads, + }) + } + if c.InnodbThreadConcurrency != nil { + o = append(o, map[string]any{ + "key": "InnodbThreadConcurrency", + "value": *c.InnodbThreadConcurrency, + }) + } + if c.InnodbWriteIoThreads != nil { + o = append(o, map[string]any{ + "key": "InnodbWriteIoThreads", + "value": *c.InnodbWriteIoThreads, + }) + } + if c.NetBufferLength != nil { + o = append(o, map[string]any{ + "key": "NetBufferLength", + "value": *c.NetBufferLength, + }) + } + if c.LogOutput != nil { + o = append(o, map[string]any{ + "key": "LogOutput", + "value": *c.LogOutput, + }) + } return o } @@ -1578,6 +1620,26 @@ func (dc *PostgreSQLConfiguration) KV() []map[string]any { "value": *c.TimeScaleDB.MaxBackgroundWorkers, }) } + + if c.SynchronousReplication != nil { + o = append(o, map[string]any{ + "key": "SynchronousReplication", + "value": *c.SynchronousReplication, + }) + } + if c.StatMonitorEnable != nil { + o = append(o, map[string]any{ + "key": "StatMonitorEnable", + "value": *c.StatMonitorEnable, + }) + } + if c.MaxFailoverReplicationTimeLag != nil { + o = append(o, map[string]any{ + "key": "MaxFailoverReplicationTimeLag", + "value": *c.MaxFailoverReplicationTimeLag, + }) + } + return o } diff --git a/go.mod b/go.mod index 78549b1fa..324d29da5 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 require ( github.com/blang/semver v3.5.1+incompatible github.com/creack/pty v1.1.21 - github.com/digitalocean/godo v1.129.1-0.20241113153826-8f5ac1bc9671 + github.com/digitalocean/godo v1.130.0 github.com/docker/cli v24.0.5+incompatible github.com/docker/docker v25.0.6+incompatible github.com/docker/docker-credential-helpers v0.7.0 // indirect @@ -30,7 +30,7 @@ require ( github.com/stretchr/testify v1.8.4 golang.org/x/crypto v0.22.0 golang.org/x/net v0.24.0 // indirect - golang.org/x/oauth2 v0.23.0 + golang.org/x/oauth2 v0.24.0 golang.org/x/sys v0.25.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.26.2 @@ -122,7 +122,7 @@ require ( go.opentelemetry.io/otel/trace v1.19.0 // indirect golang.org/x/mod v0.11.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.6.0 // indirect + golang.org/x/time v0.8.0 // indirect golang.org/x/tools v0.10.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index f688b8dc4..ad87a3917 100644 --- a/go.sum +++ b/go.sum @@ -91,8 +91,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/digitalocean/godo v1.129.1-0.20241113153826-8f5ac1bc9671 h1:ZWx8CdoEZ0ZM9jy+hUOVL6OZJtm9Nb6rBCVhF2sokog= -github.com/digitalocean/godo v1.129.1-0.20241113153826-8f5ac1bc9671/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= +github.com/digitalocean/godo v1.130.0 h1:DbJg0wvBxTkYjY5Q9S1mwzAZLd5Wht3r57yFH4yeMCk= +github.com/digitalocean/godo v1.130.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rMi4aXAvodc= @@ -517,8 +517,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= -golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -599,8 +599,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= -golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= +golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= diff --git a/integration/database_config_get_test.go b/integration/database_config_get_test.go index 75e2c42a2..71d18f330 100644 --- a/integration/database_config_get_test.go +++ b/integration/database_config_get_test.go @@ -177,30 +177,46 @@ SlowQueryLog false LongQueryTime 10 BackupHour 18 BackupMinute 3 +BinlogRetentionPeriod 600 +InnodbChangeBufferMaxSize 25 +InnodbFlushNeighbors 0 +InnodbReadIoThreads 16 +InnodbThreadConcurrency 1000 +InnodbWriteIoThreads 16 +NetBufferLength 4096 +LogOutput NONE ` databaseConfigMySQLGetResponse = ` { - "config": { - "default_time_zone": "UTC", - "max_allowed_packet": 67108864, - "sql_mode": "ANSI,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,STRICT_ALL_TABLES", - "sql_require_primary_key": true, - "innodb_change_buffer_max_size": 25, - "innodb_flush_neighbors": 1, - "innodb_ft_min_token_size": 3, - "innodb_ft_server_stopword_table": "", - "innodb_print_all_deadlocks": false, - "innodb_read_io_threads": 4, - "innodb_rollback_on_timeout": false, - "innodb_thread_concurrency": 0, - "innodb_write_io_threads": 4, - "net_buffer_length": 16384, - "slow_query_log": false, - "long_query_time": 10, - "backup_hour": 18, - "backup_minute": 3 - } + "config": { + "default_time_zone": "UTC", + "max_allowed_packet": 67108864, + "sql_mode": "ANSI,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,STRICT_ALL_TABLES", + "sql_require_primary_key": true, + "innodb_change_buffer_max_size": 25, + "innodb_flush_neighbors": 1, + "innodb_ft_min_token_size": 3, + "innodb_ft_server_stopword_table": "", + "innodb_print_all_deadlocks": false, + "innodb_read_io_threads": 4, + "innodb_rollback_on_timeout": false, + "innodb_thread_concurrency": 0, + "innodb_write_io_threads": 4, + "net_buffer_length": 16384, + "slow_query_log": false, + "long_query_time": 10, + "backup_hour": 18, + "backup_minute": 3, + "binlog_retention_period": 600, + "innodb_change_buffer_max_size": 25, + "innodb_flush_neighbors": 0, + "innodb_read_io_threads": 16, + "innodb_thread_concurrency": 1000, + "innodb_write_io_threads": 16, + "net_buffer_length": 4096, + "log_output": "NONE" + } }` databaseConfigPGGetOutput = ` @@ -231,42 +247,49 @@ PgBouncer.AutodbPoolSize 0 PgBouncer.AutodbMaxDbConnections 0 PgBouncer.AutodbIdleTimeout 0 BackupHour 18 -BackupMinute 26` +BackupMinute 26 +WorkMem 4 +SynchronousReplication off +StatMonitorEnable false +MaxFailoverReplicationTimeLag 12` databaseConfigPGGetResponse = `{ -"config": { - "autovacuum_naptime": 60, - "autovacuum_vacuum_threshold": 50, - "autovacuum_analyze_threshold": 50, - "autovacuum_vacuum_scale_factor": 0.2, - "autovacuum_analyze_scale_factor": 0.2, - "autovacuum_vacuum_cost_delay": 20, - "autovacuum_vacuum_cost_limit": -1, - "bgwriter_flush_after": 512, - "bgwriter_lru_maxpages": 100, - "bgwriter_lru_multiplier": 2, - "idle_in_transaction_session_timeout": 0, - "jit": true, - "log_autovacuum_min_duration": -1, - "log_min_duration_statement": -1, - "max_prepared_transactions": 0, - "max_parallel_workers": 8, - "max_parallel_workers_per_gather": 2, - "temp_file_limit": -1, - "wal_sender_timeout": 60000, - "pgbouncer": { - "server_reset_query_always": false, - "min_pool_size": 0, - "server_idle_timeout": 0, - "autodb_pool_size": 0, - "autodb_max_db_connections": 0, - "autodb_idle_timeout": 0 - }, - "backup_hour": 18, - "backup_minute": 26, - "timescaledb": {}, - "stat_monitor_enable": false -} + "config": { + "autovacuum_naptime": 60, + "autovacuum_vacuum_threshold": 50, + "autovacuum_analyze_threshold": 50, + "autovacuum_vacuum_scale_factor": 0.2, + "autovacuum_analyze_scale_factor": 0.2, + "autovacuum_vacuum_cost_delay": 20, + "autovacuum_vacuum_cost_limit": -1, + "bgwriter_flush_after": 512, + "bgwriter_lru_maxpages": 100, + "bgwriter_lru_multiplier": 2, + "idle_in_transaction_session_timeout": 0, + "jit": true, + "log_autovacuum_min_duration": -1, + "log_min_duration_statement": -1, + "max_prepared_transactions": 0, + "max_parallel_workers": 8, + "max_parallel_workers_per_gather": 2, + "temp_file_limit": -1, + "wal_sender_timeout": 60000, + "pgbouncer": { + "server_reset_query_always": false, + "min_pool_size": 0, + "server_idle_timeout": 0, + "autodb_pool_size": 0, + "autodb_max_db_connections": 0, + "autodb_idle_timeout": 0 + }, + "backup_hour": 18, + "backup_minute": 26, + "timescaledb": {}, + "stat_monitor_enable": false, + "work_mem": 4, + "synchronous_replication": "off", + "max_failover_replication_time_lag": 12 + } }` databaseConfigRedisGetOutput = ` @@ -282,89 +305,89 @@ RedisACLChannelsDefault allchannels ` databaseConfigRedisGetResponse = `{ - "config": { - "redis_maxmemory_policy": "volatile-lru", - "redis_lfu_log_factor": 10, - "redis_lfu_decay_time": 1, - "redis_ssl": true, - "redis_timeout": 600, - "redis_notify_keyspace_events": "", - "redis_persistence": "rdb", - "redis_acl_channels_default": "allchannels" - } - }` + "config": { + "redis_maxmemory_policy": "volatile-lru", + "redis_lfu_log_factor": 10, + "redis_lfu_decay_time": 1, + "redis_ssl": true, + "redis_timeout": 600, + "redis_notify_keyspace_events": "", + "redis_persistence": "rdb", + "redis_acl_channels_default": "allchannels" + } +}` databaseConfigMongoDBGetResponse = `{ - "config": { - "default_read_concern": "local", - "default_write_concern": "majority", - "slow_op_threshold_ms": 100, - "transaction_lifetime_limit_seconds": 60, - "verbosity": 1 - } - }` + "config": { + "default_read_concern": "local", + "default_write_concern": "majority", + "slow_op_threshold_ms": 100, + "transaction_lifetime_limit_seconds": 60, + "verbosity": 1 + } +}` databaseConfigKafkaGetResponse = `{ - "config": { - "group_initial_rebalance_delay_ms": 3000, - "group_min_session_timeout_ms": 6000, - "group_max_session_timeout_ms": 1800000, - "message_max_bytes": 1048588, - "log_cleaner_delete_retention_ms": 86400000, - "log_cleaner_min_compaction_lag_ms": 0, - "log_flush_interval_ms": 9223372036854776000, - "log_index_interval_bytes": 4096, - "log_message_downconversion_enable": true, - "log_message_timestamp_difference_max_ms": 9223372036854776000, - "log_preallocate": false, - "log_retention_bytes": -1, - "log_retention_hours": 168, - "log_retention_ms": 604800000, - "log_roll_jitter_ms": 0, - "log_segment_delete_delay_ms": 60000, - "auto_create_topics_enable": true - } - }` + "config": { + "group_initial_rebalance_delay_ms": 3000, + "group_min_session_timeout_ms": 6000, + "group_max_session_timeout_ms": 1800000, + "message_max_bytes": 1048588, + "log_cleaner_delete_retention_ms": 86400000, + "log_cleaner_min_compaction_lag_ms": 0, + "log_flush_interval_ms": 9223372036854776000, + "log_index_interval_bytes": 4096, + "log_message_downconversion_enable": true, + "log_message_timestamp_difference_max_ms": 9223372036854776000, + "log_preallocate": false, + "log_retention_bytes": -1, + "log_retention_hours": 168, + "log_retention_ms": 604800000, + "log_roll_jitter_ms": 0, + "log_segment_delete_delay_ms": 60000, + "auto_create_topics_enable": true + } +}` databaseConfigOpensearchGetResponse = `{ - "config": { - "ism_enabled": true, - "ism_history_enabled": true, - "ism_history_max_age_hours": 24, - "ism_history_max_docs": 2500000, - "ism_history_rollover_check_period_hours": 8, - "ism_history_rollover_retention_period_days": 30, - "http_max_content_length_bytes": 100000000, - "http_max_header_size_bytes": 8192, - "http_max_initial_line_length_bytes": 4096, - "indices_query_bool_max_clause_count": 1024, - "search_max_buckets": 10000, - "indices_fielddata_cache_size_percentage": 0, - "indices_memory_index_buffer_size_percentage": 10, - "indices_memory_min_index_buffer_size_mb": 48, - "indices_memory_max_index_buffer_size_mb": 0, - "indices_queries_cache_size_percentage": 10, - "indices_recovery_max_mb_per_sec": 40, - "indices_recovery_max_concurrent_file_chunks": 2, - "action_auto_create_index_enabled": true, - "action_destructive_requires_name": false, - "plugins_alerting_filter_by_backend_roles_enabled": false, - "enable_security_audit": false, - "thread_pool_search_size": 0, - "thread_pool_search_throttled_size": 0, - "thread_pool_search_throttled_queue_size": 0, - "thread_pool_search_queue_size": 0, - "thread_pool_get_size": 0, - "thread_pool_get_queue_size": 0, - "thread_pool_analyze_size": 0, - "thread_pool_analyze_queue_size": 0, - "thread_pool_write_size": 0, - "thread_pool_write_queue_size": 0, - "thread_pool_force_merge_size": 0, - "override_main_response_version": false, - "script_max_compilations_rate": "use-context", - "cluster_max_shards_per_node": 0, - "cluster_routing_allocation_node_concurrent_recoveries": 2 - } - }` + "config": { + "ism_enabled": true, + "ism_history_enabled": true, + "ism_history_max_age_hours": 24, + "ism_history_max_docs": 2500000, + "ism_history_rollover_check_period_hours": 8, + "ism_history_rollover_retention_period_days": 30, + "http_max_content_length_bytes": 100000000, + "http_max_header_size_bytes": 8192, + "http_max_initial_line_length_bytes": 4096, + "indices_query_bool_max_clause_count": 1024, + "search_max_buckets": 10000, + "indices_fielddata_cache_size_percentage": 0, + "indices_memory_index_buffer_size_percentage": 10, + "indices_memory_min_index_buffer_size_mb": 48, + "indices_memory_max_index_buffer_size_mb": 0, + "indices_queries_cache_size_percentage": 10, + "indices_recovery_max_mb_per_sec": 40, + "indices_recovery_max_concurrent_file_chunks": 2, + "action_auto_create_index_enabled": true, + "action_destructive_requires_name": false, + "plugins_alerting_filter_by_backend_roles_enabled": false, + "enable_security_audit": false, + "thread_pool_search_size": 0, + "thread_pool_search_throttled_size": 0, + "thread_pool_search_throttled_queue_size": 0, + "thread_pool_search_queue_size": 0, + "thread_pool_get_size": 0, + "thread_pool_get_queue_size": 0, + "thread_pool_analyze_size": 0, + "thread_pool_analyze_queue_size": 0, + "thread_pool_write_size": 0, + "thread_pool_write_queue_size": 0, + "thread_pool_force_merge_size": 0, + "override_main_response_version": false, + "script_max_compilations_rate": "use-context", + "cluster_max_shards_per_node": 0, + "cluster_routing_allocation_node_concurrent_recoveries": 2 + } +}` ) diff --git a/vendor/github.com/digitalocean/godo/CHANGELOG.md b/vendor/github.com/digitalocean/godo/CHANGELOG.md index 735ab4ff0..68e7d48f5 100644 --- a/vendor/github.com/digitalocean/godo/CHANGELOG.md +++ b/vendor/github.com/digitalocean/godo/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## [v1.130.0] - 2024-11-14 + +- #755 - @vsharma6855 - Add Missing Database Configs for Postgresql and MYSQL +- #754 - @blesswinsamuel - APPS-9858 Add method to obtain websocket URL to get console access into components + ## [v1.129.0] - 2024-11-06 - #752 - @andrewsomething - Support maps in Stringify diff --git a/vendor/github.com/digitalocean/godo/godo.go b/vendor/github.com/digitalocean/godo/godo.go index a399bc3eb..4b9ad6b61 100644 --- a/vendor/github.com/digitalocean/godo/godo.go +++ b/vendor/github.com/digitalocean/godo/godo.go @@ -21,7 +21,7 @@ import ( ) const ( - libraryVersion = "1.129.0" + libraryVersion = "1.130.0" defaultBaseURL = "https://api.digitalocean.com/" userAgent = "godo/" + libraryVersion mediaType = "application/json" diff --git a/vendor/golang.org/x/oauth2/README.md b/vendor/golang.org/x/oauth2/README.md index 781770c20..48dbb9d84 100644 --- a/vendor/golang.org/x/oauth2/README.md +++ b/vendor/golang.org/x/oauth2/README.md @@ -5,15 +5,6 @@ oauth2 package contains a client implementation for OAuth 2.0 spec. -## Installation - -~~~~ -go get golang.org/x/oauth2 -~~~~ - -Or you can manually git clone the repository to -`$(go env GOPATH)/src/golang.org/x/oauth2`. - See pkg.go.dev for further documentation and examples. * [pkg.go.dev/golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) @@ -33,7 +24,11 @@ The main issue tracker for the oauth2 repository is located at https://github.com/golang/oauth2/issues. This repository uses Gerrit for code changes. To learn how to submit changes to -this repository, see https://golang.org/doc/contribute.html. In particular: +this repository, see https://go.dev/doc/contribute. + +The git repository is https://go.googlesource.com/oauth2. + +Note: * Excluding trivial changes, all contributions should be connected to an existing issue. * API changes must go through the [change proposal process](https://go.dev/s/proposal-process) before they can be accepted. diff --git a/vendor/golang.org/x/time/rate/rate.go b/vendor/golang.org/x/time/rate/rate.go index 8f6c7f493..93a798ab6 100644 --- a/vendor/golang.org/x/time/rate/rate.go +++ b/vendor/golang.org/x/time/rate/rate.go @@ -99,8 +99,9 @@ func (lim *Limiter) Tokens() float64 { // bursts of at most b tokens. func NewLimiter(r Limit, b int) *Limiter { return &Limiter{ - limit: r, - burst: b, + limit: r, + burst: b, + tokens: float64(b), } } @@ -344,18 +345,6 @@ func (lim *Limiter) reserveN(t time.Time, n int, maxFutureReserve time.Duration) tokens: n, timeToAct: t, } - } else if lim.limit == 0 { - var ok bool - if lim.burst >= n { - ok = true - lim.burst -= n - } - return Reservation{ - ok: ok, - lim: lim, - tokens: lim.burst, - timeToAct: t, - } } t, tokens := lim.advance(t) diff --git a/vendor/modules.txt b/vendor/modules.txt index 20b23e3b5..73832a0dd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -61,7 +61,7 @@ github.com/creack/pty # github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc ## explicit github.com/davecgh/go-spew/spew -# github.com/digitalocean/godo v1.129.1-0.20241113153826-8f5ac1bc9671 +# github.com/digitalocean/godo v1.130.0 ## explicit; go 1.22 github.com/digitalocean/godo github.com/digitalocean/godo/metrics @@ -439,7 +439,7 @@ golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/socks golang.org/x/net/proxy -# golang.org/x/oauth2 v0.23.0 +# golang.org/x/oauth2 v0.24.0 ## explicit; go 1.18 golang.org/x/oauth2 golang.org/x/oauth2/internal @@ -462,7 +462,7 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/time v0.6.0 +# golang.org/x/time v0.8.0 ## explicit; go 1.18 golang.org/x/time/rate # golang.org/x/tools v0.10.0