Documentation ¶
Index ¶
- func Binary(customBinary string) (string, error)
- type Client
- func (c *Client) ApplyMetadata(ctx context.Context, debug bool) error
- func (c *Client) ApplyMigrations(ctx context.Context, debug bool) error
- func (c *Client) ApplySeed(ctx context.Context, debug bool) error
- func (c *Client) ApplySeeds(tables []TableEntry) ([]byte, error)
- func (c *Client) ClearMigration(source string) error
- func (c *Client) ExportMetadata(ctx context.Context, debug bool) error
- func (c *Client) GetExtensions() ([]string, error)
- func (c *Client) GetInconsistentMetadata() (InconsistentMetadataResponse, error)
- func (c *Client) GetMetadata() (*MetadataV3, error)
- func (c *Client) GetSchemas() ([]string, error)
- func (c *Client) Init(endpoint, adminSecret, customBinary string, client HttpDoer) error
- func (c *Client) Migration(options []string) ([]byte, error)
- func (c *Client) PGDump(options []string) ([]byte, error)
- func (c *Client) ReloadMetadata(ctx context.Context, debug bool) error
- func (c *Client) Request(body []byte, path string) (*http.Response, error)
- func (c *Client) Seed(payload string) error
- func (c *Client) StartConsole(ctx context.Context, consolePort, consoleAPIPort uint32, debug bool) error
- func (c *Client) StopConsole() error
- func (c *Client) Track(table TableEntry) error
- type CommonMetadataOperations
- type HttpDoer
- type InconsistentMetadataResponse
- type MetadataV3
- type Migration
- type PGDumpRequest
- type QualifiedTable
- type RequestBody
- type Response
- type Source
- type TableEntry
- type V2ReplaceMetadataArgs
- type V2ReplaceMetadataResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Endpoint string AdminSecret string Client HttpDoer CLI string CommonOptions []string CommonOptionsWithoutDB []string // contains filtered or unexported fields }
func InitClient ¶ added in v0.7.1
func (*Client) ApplyMetadata ¶ added in v0.7.1
func (*Client) ApplyMigrations ¶ added in v0.7.1
func (*Client) ApplySeeds ¶
func (c *Client) ApplySeeds(tables []TableEntry) ([]byte, error)
func (*Client) ClearMigration ¶
func (*Client) ExportMetadata ¶ added in v0.7.1
func (*Client) GetExtensions ¶
func (*Client) GetInconsistentMetadata ¶ added in v0.6.5
func (c *Client) GetInconsistentMetadata() (InconsistentMetadataResponse, error)
func (*Client) GetMetadata ¶
func (c *Client) GetMetadata() (*MetadataV3, error)
func (*Client) GetSchemas ¶
func (*Client) Init ¶
Initialize the client with supplied Hasura endpoint, admin secret and a custom HTTP client.
func (*Client) ReloadMetadata ¶ added in v0.8.22
func (*Client) StartConsole ¶ added in v0.7.1
func (*Client) StopConsole ¶ added in v0.7.1
func (*Client) Track ¶
func (c *Client) Track(table TableEntry) error
type CommonMetadataOperations ¶
type CommonMetadataOperations interface { ExportMetadata() (metadata io.Reader, err error) ClearMetadata() (io.Reader, error) ReloadMetadata() (io.Reader, error) DropInconsistentMetadata() (io.Reader, error) ReplaceMetadata(metadata io.Reader) (io.Reader, error) GetInconsistentMetadata() (*InconsistentMetadataResponse, error) GetInconsistentMetadataReader() (io.Reader, error) }
general hasura metadata API requests these are not dependent on the connected source type
type InconsistentMetadataResponse ¶ added in v0.6.5
type InconsistentMetadataResponse struct { IsConsistent bool `json:"is_consistent"` InconsistentObjects []struct { Type string `json:"type"` Name string `json:"name"` Reason string `json:"reason"` Definition struct { Name string `json:"name"` Schema string `json:"schema"` } `json:"definition"` Table struct { Name string `json:"name"` Schema string `json:"schema"` } `json:"table"` } `json:"inconsistent_objects"` }
type MetadataV3 ¶ added in v0.6.6
type MetadataV3 struct {
Sources []Source `json:"sources"`
}
type Migration ¶
type Migration struct { Name string Version int64 SQLFile string SQLServer bool Location string Data []byte }
func (*Migration) AddExtensions ¶
type PGDumpRequest ¶
type PGDumpRequest struct { Opts []string `json:"opts"` CleanOutput bool `json:"clean_output"` SourceName string `json:"source,omitempty"` }
func (*PGDumpRequest) Marshal ¶
func (r *PGDumpRequest) Marshal() ([]byte, error)
type QualifiedTable ¶
type RequestBody ¶
type RequestBody struct { Type string `json:"type"` Version uint `json:"version,omitempty"` Args interface{} `json:"args"` }
func (*RequestBody) Marshal ¶
func (r *RequestBody) Marshal() ([]byte, error)
type Response ¶
type Response struct { Path string `json:"path"` Error string `json:"error"` Code string `json:"code"` }
Hasura response
type Source ¶ added in v0.5.9
type Source struct { Name string `json:"name"` Tables []TableEntry `json:"tables"` }
type TableEntry ¶
type TableEntry struct { IsEnum *bool `json:"is_enum,omitempty"` Table QualifiedTable `json:"table"` }
func GetTablesFromLocalMetadata ¶
func GetTablesFromLocalMetadata() ([]TableEntry, error)
type V2ReplaceMetadataArgs ¶
type V2ReplaceMetadataArgs struct { AllowInconsistentMetadata bool `json:"allow_inconsistent_metadata"` Metadata interface{} `json:"metadata"` }
type V2ReplaceMetadataResponse ¶
type V2ReplaceMetadataResponse struct { IsConsistent bool `json:"is_consistent"` InconsistentObjects interface{} `json:"inconsistent_objects"` }
Click to show internal directories.
Click to hide internal directories.