Documentation ¶
Index ¶
- func CreateCassandraSession() (*gocql.Session, error)
- func CreatePKChatroomTable(session *gocql.Session)
- func CreatePKNameTable(session *gocql.Session)
- func GetAllChatData(c *gin.Context)
- func GetHTMLPage(c *gin.Context)
- func GetLatestChatData(c *gin.Context)
- func GetRunTestResult(c *gin.Context)
- func GetServerStatus(c *gin.Context)
- func InitApi() (Env, *gocql.Session, Comment)
- func InitGinApp(r *gin.Engine)
- func PostInsertChatData(c *gin.Context)
- type Comment
- func AllSelectData(session *gocql.Session) []Comment
- func ChatroomAllData(session *gocql.Session, chatroom string) []Comment
- func ChatroomLatestData(session *gocql.Session, chatroom string) []Comment
- func GenerateChatData() Comment
- func InsertData(session *gocql.Session, chatData *Comment) *Comment
- func SelectTestData(session *gocql.Session, chatData *Comment) Comment
- type Comments
- type Env
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCassandraSession ¶
connect to the cluster My envroiment : local laptop need to connect cassandra cluster with ssh tunnel example ssh ssh.host -L 9042:cassandra.host:9042
func CreatePKChatroomTable ¶
func GetAllChatData ¶
func GetHTMLPage ¶
func GetLatestChatData ¶
func GetRunTestResult ¶
func GetServerStatus ¶
func InitGinApp ¶
func PostInsertChatData ¶
Types ¶
type Comment ¶
type Comment struct { Name string `form:"name" json:"name"` Time int64 `form:"time" json:"time"` Chatroom string `form:"chatroom" json:"chatroom"` Comment string `form:"comment" json:"comment"` }
func ChatroomLatestData ¶
func InsertData ¶
Insert test data
type Env ¶
type Env struct { AppEnv string `envconfig:"APP_ENV" default:"test"` AppPort string `envconfig:"APP_PORT" default:"8081"` AppEndpoint string `envconfig:"APP_ENDPOINT" default:"http://127.0.0.1"` CassdraEndpoint string `envconfig:"CASSANDRA_ENDPOINT" default:"127.0.0.1"` CassandraPort int `envconfig:"CASSANDRA_PORT" default:"9042"` CassandraUserName string `envconfig:"CASSANDRA_USER" default:"cassandra"` CassandraUserPass string `envconfig:"CASSANDRA_PASS" default:"cassandra"` CassandraKeyspace string `envconfig:"CASSANDRA_KS" default:"example"` }
func CreateSessionConf ¶
func CreateSessionConf(env Env) (*gocql.ClusterConfig, Env)
func GetEnvValue ¶
func GetEnvValue() Env
Click to show internal directories.
Click to hide internal directories.