Interfaces and abstractions that make up go-libp2p
Go to file
vyzo e4c76cf7cd
Network Resource Manager interface (#229)
* add resource manager interfaces

* add scope accessors to streams and conns

* add ResourceManager accessor to the Network interface

* allow initially unattached streams.

* introduce service scopes, canonicalize ownership interface through setters

* make system scope explicit

* make memory stat an int64

* make the system scope a generic resource scope, introduce the DMZ

* fix typo

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* fix typo

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* rename DMZ to transient scope, remove OpenConnection from PeerScope

* remove ncopy param from GrowBuffer

* remove protocols from OpenStream

The stream is unnegotiated state until the actual protocol has been determined.

* document nil receiver contract, fix protocol scope protocol accessor method

* remove nil receiver contract requirement

* flesh out stat struct

* turn resource manager scope accessors into viewers

* interface refiniments

1. Introduce transactions in all scopes
2. Limit the view of stream/connection scope for users, to avoid the Done footgun
3. Move OpenStream to the resource manager

* add Buffer interface

* fix typo

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* fix typo

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* fix typo

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* rename user scopes to plain names, management scopes as such

* rename BeginTxn to BeginTransaction

* RIP Buffers

* make ErrResourceLimitExceeded a temporary error; move rcmgr errors with the other errors.

* unexport TemporaryError

* null resource manager stub

* unexport the null stubs, make entry point a variable

* don't rely on typed nils but instead use actual null object instances

So that we don't confuse the hell out of everyone!

* add Scope to the CapableConn interface

* rename ConnectionScope to ConnScope for consistency

* fix typo

* rename ConnectionManagementScope to ConnManagementScope

* add the ConnManagementScope to Upgrader.Upgrade

* fix argument name

* godocs for ResourceManager

* introduce MemoryStatus indicator in ReserveMemory

* use uint8 for MemoryStatus

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* rework reservation interface to pass priority instead of returning memory status

so that we don't have to undo reservations if there is too much pressure.

* improve comment

* fix typo

* export the NullScope

* Stream.SetProtocol can return an error

It needs to attach the protocol to the protocol scope, which may fail.

* merge the mux package into network

* pass the PeerScope to Multiplexer.NetConn

* Update network/rcmgr.go

Co-authored-by: raulk <raul@protocol.ai>

* Update network/rcmgr.go

Co-authored-by: raulk <raul@protocol.ai>

* Update network/rcmgr.go

Co-authored-by: raulk <raul@protocol.ai>

* Update network/rcmgr.go

Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>

* remove reference to deprecated mux.MuxedConn

* rename transaction to span

* indicate bytes in ReserveMemory

* break ResourceManager View methods into Viewer interface.

* add experimental interface warning

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
Co-authored-by: raulk <raul@protocol.ai>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2022-01-16 23:15:05 -08:00
.github/workflows sync: update CI config files (#225) 2021-12-13 12:19:25 +01:00
connmgr fix staticcheck errors (#191) 2021-03-30 16:13:36 -07:00
control add connection gating interfaces and types. (#139) 2020-05-13 13:15:38 +01:00
crypto generate ecdsa public key from an input public key (#219) 2021-12-01 23:24:12 -08:00
discovery Absorb go-libp2p abstractions and core types into this module (#1) 2019-05-22 18:31:11 +01:00
event Event for user's NAT Device Type: Tell user if the node is behind an Easy or Hard NAT (#173) 2021-02-18 14:17:27 +05:30
helpers add CloseRead/CloseWrite on streams (#166) 2020-09-01 17:29:54 -07:00
host experimental introspection support (#159) 2020-06-05 12:24:56 +01:00
introspection experimental introspection support (#159) 2020-06-05 12:24:56 +01:00
metrics feat: remove unused metrics (#208) 2021-07-23 08:21:59 -07:00
mux Network Resource Manager interface (#229) 2022-01-16 23:15:05 -08:00
network Network Resource Manager interface (#229) 2022-01-16 23:15:05 -08:00
peer remove deprecated Bytes method from the Key interface (#204) 2021-07-22 12:18:09 -07:00
peerstore add RemovePeer method to PeerMetadata, Metrics, ProtoBook and Keybook (#218) 2021-10-24 03:17:52 -07:00
pnet remove the Protector interface, introduce a PSK type (#118) 2020-03-06 17:18:20 -08:00
protocol eventbus abstraction + initial events (#17) 2019-06-20 15:59:53 +01:00
record fix staticcheck errors (#191) 2021-03-30 16:13:36 -07:00
routing fix staticcheck errors (#191) 2021-03-30 16:13:36 -07:00
sec pass the peer ID to SecureInbound in the SecureTransport and SecureMuxer (#211) 2021-09-08 03:34:32 -07:00
test Signed envelopes & routing records (#73) 2020-02-10 14:53:24 -05:00
transport Network Resource Manager interface (#229) 2022-01-16 23:15:05 -08:00
.gitignore deps: move tools to a sub-module (#130) 2020-03-09 19:57:19 -07:00
alias.go Fix typo in docs (#163) 2020-08-08 14:40:23 +03:00
go.mod update gopkg.in/yaml.v2 to v2.2.8 (#233) 2022-01-08 22:27:00 -08:00
go.sum update gopkg.in/yaml.v2 to v2.2.8 (#233) 2022-01-08 22:27:00 -08:00
LICENSE chore(license): fix license detection 2020-02-11 10:34:23 -08:00
LICENSE-APACHE Add license files (#24) 2019-06-24 18:25:52 +01:00
LICENSE-MIT Add license files (#24) 2019-06-24 18:25:52 +01:00
README.md remove minimum Go version from README (#199) 2021-07-07 11:46:25 -07:00
version.json release v0.13.0 (#227) 2021-12-12 03:58:57 -08:00

go-libp2p-core

GoDoc Coverage Status Build Status Discourse posts

Home to the interfaces and abstractions that make up go-libp2p.

Install

go get github.com/libp2p/go-libp2p-core

Usage

Check out the GoDocs.

Testing

To test instantiations of interfaces and abstractions, you can use the test suite.

License

Dual-licensed under MIT and ASLv2, by way of the Permissive License Stack.