Movatterモバイル変換


[0]ホーム

URL:


replicasync

package
v2.23.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2025 License:AGPL-3.0Imports:20Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PubsubEvent = "replica"

Functions

funcCreateDERPMeshTLSConfigadded inv2.8.5

func CreateDERPMeshTLSConfig(hostnamestring, tlsCertificates []tls.Certificate) (*tls.Config,error)

CreateDERPMeshTLSConfig creates a TLS configuration for connecting to peersin the DERP mesh over private networking. It overrides the ServerName to bethe expected public hostname of the peer, and trusts all of the TLS servercertificates used by this replica (as we expect all replicas to use the sameTLS certificates).

funcPingPeerReplicaadded inv2.8.5

func PingPeerReplica(ctxcontext.Context, clienthttp.Client, relayAddressstring)error

PingPeerReplica pings a peer replica over it's internal relay address toensure it's reachable and alive for health purposes.

Types

typeManager

type Manager struct {// contains filtered or unexported fields}

Manager keeps the replica up to date and in sync with other replicas.

funcNew

func New(ctxcontext.Context, loggerslog.Logger, dbdatabase.Store, pspubsub.Pubsub, options *Options) (*Manager,error)

New registers the replica with the database and periodically updates toensure it's healthy. It contacts all other alive replicas to ensure they arereachable.

func (*Manager)AllPrimary

func (m *Manager) AllPrimary() []database.Replica

AllPrimary returns every primary replica (not workspace proxy replicas),including itself.

func (*Manager)Close

func (m *Manager) Close()error

func (*Manager)ID

func (m *Manager) ID()uuid.UUID

func (*Manager)InRegion

func (m *Manager) InRegion(regionIDint32) []database.Replica

InRegion returns every replica in the given DERP region excluding itself.

func (*Manager)PublishUpdate

func (m *Manager) PublishUpdate()error

PublishUpdate notifies all other replicas to update.

func (*Manager)Regional

func (m *Manager) Regional() []database.Replica

Regional returns all replicas in the same region excluding itself.

func (*Manager)Self

func (m *Manager) Self()database.Replica

Self represents the current replica.

func (*Manager)SetCallback

func (m *Manager) SetCallback(callback func())

SetCallback sets a function to execute whenever new peersare refreshed or updated.

func (*Manager)UpdateNow

func (m *Manager) UpdateNow(ctxcontext.Context)error

UpdateNow synchronously updates replicas.

typeOptions

type Options struct {IDuuid.UUIDCleanupIntervaltime.DurationUpdateIntervaltime.DurationPeerTimeouttime.DurationRelayAddressstringRegionIDint32TLSConfig       *tls.Config}

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp