Documentation ¶
Index ¶
- Constants
- func ConfigAdminSecret() string
- func ConfigGraphqlURL() string
- func ConfigHasuraAccountHeader() string
- func ConfigHasuraRoleHeader() string
- func ConfigHasuraUserIdHeader() string
- func InterfaceToJson(data interface{}) (string, error)
- func TimestampToGraphQlTimestamWithTimeszone(timestamp int64) string
- type Executer
- type ExecuterImpl
- type ExecuterMock
- type GraphQlClient
- type HeaderInfo
- type HeaderInfoGetter
- type HeaderInfoGetterImpl
- type HeaderInfoGetterMock
- type InsertBaseResponse
- type InsertBaseResponseID
- type RequestHeader
- type RequestVar
- type Service
- type ServiceMock
- type SessionInfoGetter
- type SessionInfoGetterImpl
- type SessionInfoGetterMock
Constants ¶
View Source
const HASURA_ADMIN_SECRET_HEADER_NAME = "X-Hasura-Admin-Secret"
Variables ¶
This section is empty.
Functions ¶
func ConfigAdminSecret ¶
func ConfigAdminSecret() string
func ConfigGraphqlURL ¶
func ConfigGraphqlURL() string
func ConfigHasuraAccountHeader ¶
func ConfigHasuraAccountHeader() string
func ConfigHasuraRoleHeader ¶
func ConfigHasuraRoleHeader() string
func ConfigHasuraUserIdHeader ¶
func ConfigHasuraUserIdHeader() string
func InterfaceToJson ¶
Types ¶
type Executer ¶
type Executer interface {
Execute(c context.Context, q string, headers []RequestHeader, vars []RequestVar, setHasuraAdminSecret bool, result interface{}) error
}
type ExecuterImpl ¶
type ExecuterImpl struct {
Client GraphQlClient
}
func (*ExecuterImpl) Execute ¶
func (s *ExecuterImpl) Execute(c context.Context, q string, headers []RequestHeader, vars []RequestVar, setHasuraAdminSecret bool, result interface{}) error
type ExecuterMock ¶
func (*ExecuterMock) Execute ¶
func (m *ExecuterMock) Execute(c context.Context, q string, headers []RequestHeader, vars []RequestVar, setHasuraAdminSecret bool, result interface{}) error
type GraphQlClient ¶
type HeaderInfo ¶
type HeaderInfoGetter ¶
type HeaderInfoGetter interface {
GetHeaderInfo(r *http.Request) (*HeaderInfo, error)
}
type HeaderInfoGetterImpl ¶
type HeaderInfoGetterImpl struct { }
func (*HeaderInfoGetterImpl) GetHeaderInfo ¶
func (s *HeaderInfoGetterImpl) GetHeaderInfo(r *http.Request) (*HeaderInfo, error)
func (*HeaderInfoGetterImpl) GetSessionInfo ¶
func (s *HeaderInfoGetterImpl) GetSessionInfo(r map[string]interface{}) (*HeaderInfo, error)
type HeaderInfoGetterMock ¶
func (*HeaderInfoGetterMock) GetHeaderInfo ¶
func (m *HeaderInfoGetterMock) GetHeaderInfo(r *http.Request) (*HeaderInfo, error)
type InsertBaseResponse ¶
type InsertBaseResponse struct { Returning []InsertBaseResponseID `json:"returning"` AffectedRows int `json:"affected_rows"` }
type InsertBaseResponseID ¶
type InsertBaseResponseID struct {
ID string `json:"id"`
}
type RequestHeader ¶
type RequestVar ¶
type RequestVar struct { Key string Value interface{} }
type Service ¶
type Service interface { Executer HeaderInfoGetter SessionInfoGetter }
func NewService ¶
func NewService() Service
func NewServiceMock ¶
func NewServiceMock() Service
type ServiceMock ¶
type ServiceMock struct { ExecuterMock HeaderInfoGetterMock SessionInfoGetterMock }
type SessionInfoGetter ¶
type SessionInfoGetter interface {
GetSessionInfo(r map[string]interface{}) (*HeaderInfo, error)
}
type SessionInfoGetterImpl ¶
type SessionInfoGetterImpl struct { }
type SessionInfoGetterMock ¶
func (*SessionInfoGetterMock) GetSessionInfo ¶
func (m *SessionInfoGetterMock) GetSessionInfo(r map[string]interface{}) (*HeaderInfo, error)
Click to show internal directories.
Click to hide internal directories.