The Go SDK is currently in experimental status. If you would like to provide feedback, please reach out to us with your suggestions and comments on our Discord.
Note: You are viewing documentation for version v0 of Go. View the latest version.
Go - NewTopic()
Creates a new Topic.
import (
"fmt"
"github.com/nitrictech/go-sdk/nitric"
)
func main() {
updates := nitric.NewTopic("updates")
if err := nitric.Run(); err != nil {
fmt.Println(err)
}
}
Parameters
- Name
name
- Required
- Required
- Type
- string
- Description
The name of the topic to create.
Examples
Create a new topic
import (
"fmt"
"github.com/nitrictech/go-sdk/nitric"
)
func main() {
updates := nitric.NewTopic("updates")
if err := nitric.Run(); err != nil {
fmt.Println(err)
}
}