mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
26 lines
812 B
Go
26 lines
812 B
Go
package service
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type Handler struct{}
|
|
|
|
func (h *Handler) InlineStruct(w http.ResponseWriter, r *http.Request) (e InlineStruct) {
|
|
return InlineStruct{InlineStructA: InlineStructA{ValueA: "a"}}
|
|
}
|
|
|
|
func (h *Handler) InlineStructPtr(w http.ResponseWriter, r *http.Request) (e InlineStructPtr) {
|
|
return InlineStructPtr{InlineStructA: &InlineStructA{ValueA: "a"}}
|
|
}
|
|
|
|
func (h *Handler) UnionString(w http.ResponseWriter, r *http.Request) (e UnionString) {
|
|
v := UnionStringBThree
|
|
return UnionString{B: &v}
|
|
}
|
|
|
|
func (h *Handler) UnionStruct(w http.ResponseWriter, r *http.Request) (e UnionStruct) {
|
|
//return UnionStruct{UnionStructA: UnionStructA{Kind: "UnionStructA", Value: UnionStructAValueAOne}}
|
|
return UnionStruct{B: &UnionStructB{Kind: "UnionStructB", Value: UnionStructAValueBOne}}
|
|
}
|