Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GuacService ¶ added in v1.0.1
type GuacService interface { CreateGuacamoleConnection(vnchost VncHost) error CreateAdminUser(user, password string) error DeleteGuacUser(user string) error }
GuacService represents the interface for interacting with the Guacamole API.
**Methods:** CreateGuacamoleConnection: Creates a new Guacamole connection. CreateAdminUser: Creates a new Guacamole admin user. DeleteGuacUser: Deletes a Guacamole user.
type GuacServiceImpl ¶ added in v1.0.1
type GuacServiceImpl struct{}
GuacServiceImpl represents the implementation of the GuacService interface.
func (*GuacServiceImpl) CreateAdminUser ¶ added in v1.0.1
func (g *GuacServiceImpl) CreateAdminUser(user, password string) error
CreateAdminUser creates a new admin user in Guacamole with the specified username and password.
**Parameters:**
user: A string representing the desired username for the new admin user.
password: A string representing the desired password for the new admin user.
**Returns:**
error: An error if the admin user cannot be created.
Example ¶
package main import ( "fmt" ) func main() { // Define a username and password for the new admin user username := "test_admin" password := "test_password" // Create an actual instance of Guacamole service // guacService := guacinator.NewGuacService() // Call the function with the username and password // Here, instead of calling the actual function, we're just demonstrating how it would be used fmt.Println("guacService.CreateAdminUser(username, password)") _ = username _ = password }
Output: guacService.CreateAdminUser(username, password)
func (*GuacServiceImpl) CreateGuacamoleConnection ¶ added in v1.0.1
func (g *GuacServiceImpl) CreateGuacamoleConnection(vncHost VncHost) error
CreateGuacamoleConnection establishes a new connection
in Guacamole using the provided VncHost information. CreatePackageDocs generates documentation for all Go packages in the current directory and its subdirectories. It traverses the file tree using a provided afero.Fs and Repo to create a new README.md file in each directory containing a Go package. It uses a specified template file for generating the README files.
**Parameters:**
vncHost: A VncHost struct containing the necessary information for the connection.
**Returns:**
error: An error if the connection cannot be created.
Example ¶
package main import ( "fmt" guacinator "github.com/cowdogmoo/guacinator/cmd" ) func main() { // Define a VncHost struct vncHost := guacinator.VncHost{Name: "Test", IP: "192.168.1.1", Port: 5900, Password: "test_password"} // Create an actual instance of Guacamole service // guacService := guacinator.NewGuacService() // Call the function with the struct // Here, instead of calling the actual function, we're just demonstrating how it would be used fmt.Println("guacService.CreateGuacamoleConnection(vncHost)") _ = vncHost }
Output: guacService.CreateGuacamoleConnection(vncHost)
func (*GuacServiceImpl) DeleteGuacUser ¶ added in v1.0.1
func (g *GuacServiceImpl) DeleteGuacUser(user string) error
DeleteGuacUser removes a specified Guacamole user.
**Parameters:**
user: A string representing the username of the Guacamole user to be deleted.
**Returns:**
error: An error if the specified user cannot be deleted.
Example ¶
package main import ( "fmt" ) func main() { // Define a username for the Guacamole user to be deleted username := "test_user" // Create an actual instance of Guacamole service // guacService := guacinator.NewGuacService() // Call the function with the username // Here, instead of calling the actual function, we're just demonstrating how it would be used fmt.Println("guacService.DeleteGuacUser(username)") _ = username }
Output: guacService.DeleteGuacUser(username)
type VncHost ¶
VncHost represents the parameters used to establish a new connection in Guacamole.
**Attributes:** Name: A string representing the name of the VNC host. IP: A string representing the IP address of the VNC host. Port: An integer representing the port to connect to on the VNC host. Password: A string representing the password for the VNC host.