本文整理匯總了Golang中github.com/cloudfoundry-incubator/diego-ssh/test_helpers/fake_ssh.FakeConnMetadata類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeConnMetadata類的具體用法?Golang FakeConnMetadata怎麽用?Golang FakeConnMetadata使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeConnMetadata類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"github.com/onsi/gomega/ghttp"
"github.com/pivotal-golang/lager/lagertest"
"golang.org/x/crypto/ssh"
)
var _ = Describe("CFAuthenticator", func() {
var (
authenticator *authenticators.CFAuthenticator
logger *lagertest.TestLogger
httpClient *http.Client
httpClientTimeout time.Duration
permissionsBuilder *fake_authenticators.FakePermissionsBuilder
permissions *ssh.Permissions
authenErr error
metadata *fake_ssh.FakeConnMetadata
password []byte
fakeCC *ghttp.Server
fakeUAA *ghttp.Server
ccURL string
uaaTokenURL string
uaaUsername string
uaaPassword string
)
BeforeEach(func() {
logger = lagertest.NewTestLogger("test")
httpClientTimeout = time.Second
httpClient = &http.Client{Timeout: httpClientTimeout}
示例2:
"github.com/cloudfoundry-incubator/diego-ssh/authenticators"
"github.com/cloudfoundry-incubator/diego-ssh/authenticators/fake_authenticators"
"github.com/cloudfoundry-incubator/diego-ssh/test_helpers/fake_ssh"
"github.com/pivotal-golang/lager/lagertest"
"golang.org/x/crypto/ssh"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("DiegoProxyAuthenticator", func() {
var (
logger *lagertest.TestLogger
credentials []byte
permissionsBuilder *fake_authenticators.FakePermissionsBuilder
authenticator *authenticators.DiegoProxyAuthenticator
metadata *fake_ssh.FakeConnMetadata
)
BeforeEach(func() {
logger = lagertest.NewTestLogger("test")
credentials = []byte("some-user:some-password")
permissionsBuilder = &fake_authenticators.FakePermissionsBuilder{}
permissionsBuilder.BuildReturns(&ssh.Permissions{}, nil)
authenticator = authenticators.NewDiegoProxyAuthenticator(logger, credentials, permissionsBuilder)
metadata = &fake_ssh.FakeConnMetadata{}
})
Describe("Authenticate", func() {
示例3:
import (
"errors"
"github.com/cloudfoundry-incubator/diego-ssh/authenticators"
"github.com/cloudfoundry-incubator/diego-ssh/authenticators/fake_authenticators"
"github.com/cloudfoundry-incubator/diego-ssh/test_helpers/fake_ssh"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"golang.org/x/crypto/ssh"
)
var _ = Describe("CompositeAuthenticator", func() {
Describe("Authenticate", func() {
var (
authenticator *authenticators.CompositeAuthenticator
authenticatorMap map[string]authenticators.PasswordAuthenticator
metadata *fake_ssh.FakeConnMetadata
password []byte
)
BeforeEach(func() {
authenticatorMap = map[string]authenticators.PasswordAuthenticator{}
metadata = &fake_ssh.FakeConnMetadata{}
password = []byte{}
})
JustBeforeEach(func() {
authenticator = authenticators.NewCompositeAuthenticator(authenticatorMap)
})
Context("when no authenticators are specified", func() {
It("fails to authenticate", func() {
示例4:
"github.com/cloudfoundry-incubator/diego-ssh/test_helpers/fake_ssh"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/fake_receptor"
"github.com/pivotal-golang/lager/lagertest"
"golang.org/x/crypto/ssh"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("DiegoProxyAuthenticator", func() {
var (
receptorClient *fake_receptor.FakeClient
expectedRoute routes.SSHRoute
desiredLRPResponse receptor.DesiredLRPResponse
actualLrpResponse receptor.ActualLRPResponse
authenticator *authenticators.DiegoProxyAuthenticator
logger *lagertest.TestLogger
receptorCreds []byte
metadata *fake_ssh.FakeConnMetadata
)
BeforeEach(func() {
receptorClient = new(fake_receptor.FakeClient)
expectedRoute = routes.SSHRoute{
ContainerPort: 1111,
PrivateKey: "pem-encoded-key",
HostFingerprint: "host-fingerprint",
User: "user",
Password: "password",
}
示例5:
"golang.org/x/crypto/ssh"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("PermissionsBuilder", func() {
Describe("Build", func() {
var (
logger *lagertest.TestLogger
expectedRoute routes.SSHRoute
desiredLRP *models.DesiredLRP
actualLRPGroup *models.ActualLRPGroup
bbsClient *fake_bbs.FakeClient
credentials []byte
metadata *fake_ssh.FakeConnMetadata
permissionsBuilder authenticators.PermissionsBuilder
permissions *ssh.Permissions
buildErr error
processGuid string
index int
)
BeforeEach(func() {
logger = lagertest.NewTestLogger("test")
expectedRoute = routes.SSHRoute{
ContainerPort: 1111,
PrivateKey: "pem-encoded-key",
HostFingerprint: "host-fingerprint",
示例6:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/ghttp"
"github.com/pivotal-golang/lager/lagertest"
"golang.org/x/crypto/ssh"
)
var _ = Describe("CFAuthenticator", func() {
var (
authenticator *authenticators.CFAuthenticator
logger *lagertest.TestLogger
ccClient *http.Client
ccClientTimeout time.Duration
receptorClient *fake_receptor.FakeClient
permissions *ssh.Permissions
err error
metadata *fake_ssh.FakeConnMetadata
password []byte
fakeCC *ghttp.Server
ccURL string
)
BeforeEach(func() {
logger = lagertest.NewTestLogger("test")
ccClientTimeout = time.Second
ccClient = &http.Client{Timeout: ccClientTimeout}
receptorClient = new(fake_receptor.FakeClient)
metadata = &fake_ssh.FakeConnMetadata{}