Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BlueprintAlice = MustValidate(Blueprint{ Name: "alice", Homeservers: []Homeserver{ { Name: "hs1", Users: []User{ { Localpart: "@alice", DisplayName: "Alice", }, }, }, }, })
BlueprintAlice is a single user homeserver
var BlueprintCleanHS = MustValidate(Blueprint{ Name: "clean_hs", Homeservers: []Homeserver{ { Name: "hs1", }, }, })
BlueprintCleanHS is a clean homeserver with no rooms or users
var BlueprintFederationOneToOneRoom = MustValidate(Blueprint{ Name: "federation_one_to_one_room", Homeservers: []Homeserver{ { Name: "hs1", Users: []User{ { Localpart: "@alice", DisplayName: "Alice", }, }, Rooms: []Room{ { CreateRoom: map[string]interface{}{ "preset": "public_chat", }, Creator: "@alice", Ref: "alice_room", Events: []Event{ { Type: "m.room.message", Content: map[string]interface{}{ "body": "Hello world", "msgtype": "m.text", }, Sender: "@alice", }, }, }, }, }, { Name: "hs2", Users: []User{ { Localpart: "@bob", DisplayName: "Bob", }, }, Rooms: []Room{ { Ref: "alice_room", Events: []Event{ { Type: "m.room.member", StateKey: Ptr("@bob:hs2"), Content: map[string]interface{}{ "membership": "join", }, Sender: "@bob", }, { Type: "m.room.message", Content: map[string]interface{}{ "body": "Hello world2", "msgtype": "m.text", }, Sender: "@bob", }, }, }, }, }, }, })
BlueprintFederationOneToOneRoom contains two homeservers with 1 user in each, who are joined to the same room.
var BlueprintFederationTwoLocalOneRemote = MustValidate(Blueprint{ Name: "federation_two_local_one_remote", Homeservers: []Homeserver{ { Name: "hs1", Users: []User{ { Localpart: "@alice", DisplayName: "Alice", }, { Localpart: "@bob", DisplayName: "Bob", }, }, }, { Name: "hs2", Users: []User{ { Localpart: "@charlie", DisplayName: "Charlie", }, }, }, }, })
BlueprintFederationTwoLocalOneRemote is a two-user homeserver federating with a one-user homeserver
var BlueprintHSWithApplicationService = MustValidate(Blueprint{ Name: "hs_with_application_service", Homeservers: []Homeserver{ { Name: "hs1", Users: []User{ { Localpart: "@alice", DisplayName: "Alice", }, { Localpart: "@bob", DisplayName: "Bob", }, }, ApplicationServices: []ApplicationService{ { ID: "my_as_id", URL: "http://localhost:9000", SenderLocalpart: "the-bridge-user", RateLimited: false, }, }, }, { Name: "hs2", Users: []User{ { Localpart: "@charlie", DisplayName: "Charlie", }, }, }, }, })
BlueprintHSWithApplicationService who has an application service to interact with
var BlueprintOneToOneRoom = MustValidate(Blueprint{ Name: "one_to_one_room", Homeservers: []Homeserver{ { Name: "hs1", Users: []User{ { Localpart: "@alice", DisplayName: "Alice", }, { Localpart: "@bob", DisplayName: "Bob", }, }, Rooms: []Room{ { CreateRoom: map[string]interface{}{ "preset": "public_chat", }, Creator: "@alice", Events: []Event{ { Type: "m.room.member", StateKey: Ptr("@bob:hs1"), Content: map[string]interface{}{ "membership": "join", }, Sender: "@bob", }, { Type: "m.room.message", Content: map[string]interface{}{ "body": "Hello world", "msgtype": "m.text", }, Sender: "@bob", }, }, }, }, }, }, })
BlueprintOneToOneRoom contains a homeserver with 2 users, who are joined to the same room.
var BlueprintPerfManyMessages = MustValidate(Blueprint{ Name: "perf_many_messages", Homeservers: []Homeserver{ { Name: "hs1", Users: []User{ { Localpart: "@alice", DisplayName: "Alice", }, { Localpart: "@bob", DisplayName: "Bob", }, }, Rooms: []Room{ { CreateRoom: map[string]interface{}{ "preset": "public_chat", }, Creator: "@alice", Events: append([]Event{ Event{ Type: "m.room.member", StateKey: Ptr("@bob:hs1"), Content: map[string]interface{}{ "membership": "join", }, Sender: "@bob", }, }, manyMessages([]string{"@alice", "@bob"}, 7000)...), }, }, }, }, })
BlueprintPerfManyMessages contains a homeserver with 2 users, who are joined to the same room with thousands of messages.
var BlueprintPerfManyRooms = MustValidate(Blueprint{ Name: "perf_many_rooms", Homeservers: []Homeserver{ { Name: "hs1", Users: []User{ { Localpart: "@alice", DisplayName: "Alice", }, { Localpart: "@bob", DisplayName: "Bob", }, }, Rooms: perfManyRooms([]string{"@alice", "@bob"}, 400), }, }, })
BlueprintPerfManyRooms contains a homeserver with 2 users, who are joined to hundreds of rooms with a few messages in each.
var KnownBlueprints = map[string]*Blueprint{ BlueprintCleanHS.Name: &BlueprintCleanHS, BlueprintAlice.Name: &BlueprintAlice, BlueprintFederationOneToOneRoom.Name: &BlueprintFederationOneToOneRoom, BlueprintFederationTwoLocalOneRemote.Name: &BlueprintFederationTwoLocalOneRemote, BlueprintHSWithApplicationService.Name: &BlueprintHSWithApplicationService, BlueprintOneToOneRoom.Name: &BlueprintOneToOneRoom, BlueprintPerfManyMessages.Name: &BlueprintPerfManyMessages, BlueprintPerfManyRooms.Name: &BlueprintPerfManyRooms, }
KnownBlueprints lists static blueprints
Functions ¶
Types ¶
type AccountData ¶
type ApplicationService ¶
type Blueprint ¶
type Blueprint struct { // The name of the blueprint. Containers will use this name. Name string // The list of homeservers to create for this deployment. Homeservers []Homeserver // A set of user IDs to retain access_tokens for. If empty, all tokens are kept. KeepAccessTokensForUsers []string }
Blueprint represents an entire deployment to make.
func MustValidate ¶
type Homeserver ¶
type Homeserver struct { // The name of this homeserver. Containers will use this name. Name string // The list of users to create on this homeserver. Users []User // The list of rooms to create on this homeserver Rooms []Room // The list of application services to create on the homeserver ApplicationServices []ApplicationService // Optionally override the baseImageURI for blueprint creation BaseImageURI *string }