Documentation
¶
Overview ¶
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // HostnameRunningComplement is the hostname of Complement from the perspective of a Homeserver. HostnameRunningComplement = "host.docker.internal" // HostnameRunningDocker is the hostname of the docker daemon from the perspective of Complement. HostnameRunningDocker = "localhost" )
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct { Config *config.Complement CSAPIPort int FederationPort int Docker *client.Client }
func NewBuilder ¶
func NewBuilder(cfg *config.Complement) (*Builder, error)
type Deployer ¶
type Deployer struct { DeployNamespace string Docker *client.Client Counter int // contains filtered or unexported fields }
func NewDeployer ¶
func NewDeployer(deployNamespace string, cfg *config.Complement) (*Deployer, error)
func (*Deployer) Destroy ¶
func (d *Deployer) Destroy(dep *Deployment, printServerLogs bool)
Destroy a deployment. This will kill all running containers.
type Deployment ¶
type Deployment struct { // The Deployer which was responsible for this deployment Deployer *Deployer // The name of the deployed blueprint BlueprintName string // A map of HS name to a HomeserverDeployment HS map[string]HomeserverDeployment }
Deployment is the complete instantiation of a Blueprint, with running containers for each homeserver in the Blueprint.
func (*Deployment) Client ¶
Client returns a CSAPI client targeting the given hsName, using the access token for the given userID. Fails the test if the hsName is not found. Returns an unauthenticated client if userID is "", fails the test if the userID is otherwise not found.
func (*Deployment) Destroy ¶
func (d *Deployment) Destroy(t *testing.T)
Destroy the entire deployment. Destroys all running containers. If `printServerLogs` is true, will print container logs before killing the container.
func (*Deployment) RegisterUser ¶
RegisterUser within a homeserver and return an authenticatedClient, Fails the test if the hsName is not found.
type HomeserverDeployment ¶
type HomeserverDeployment struct { BaseURL string // e.g http://localhost:38646 FedBaseURL string // e.g https://localhost:48373 ContainerID string // e.g 10de45efba AccessTokens map[string]string // e.g { "@alice:hs1": "myAcc3ssT0ken" } ApplicationServices map[string]string // e.g { "my-as-id": "id: xxx\nas_token: xxx ..."} } }
HomeserverDeployment represents a running homeserver in a container.
type RoundTripper ¶
type RoundTripper struct {
Deployment *Deployment
}
RoundTripper is a round tripper that maps https://hs1 to the federation port of the container e.g https://localhost:35352