PeerID key pair algorithm on IPFS

Hello, i need to understand how peerID is create from scratch, i saw the source code of js-libp2p-peerID and i found that 3 algorithms is up to create the private and the public key of a peer. RSA, ed25519 and secp256k1 are used for. My question is, there is a parameter to choose which of those we can use to generate key pair ? Or maybe in the go implementation this is different and only one of this has been used ?

Checkout the specs specs/peer-ids.md at master · libp2p/specs · GitHub.