hasura

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(hasura config.Hasura, cfg config.Database, views []string, models ...interface{}) error

Create - creates hasura models

func Generate

func Generate(hasura config.Hasura, cfg config.Database, models ...interface{}) (map[string]interface{}, error)

Generate - creates hasura table structure in JSON from `models`. `models` should be pointer to your table models. `cfg` is DB config from YAML.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API -

func New

func New(baseURL, secret string) *API

New -

func (*API) CreateSelectPermissions added in v0.1.8

func (api *API) CreateSelectPermissions(table, role string, perm Permission) error

CreateSelectPermissions - A select permission is used to restrict access to only the specified columns and rows.

func (*API) DropSelectPermissions added in v0.1.9

func (api *API) DropSelectPermissions(table, role string) error

DropSelectPermissions -

func (*API) ExportMetadata

func (api *API) ExportMetadata(data interface{}) (ExportMetadataResponse, error)

ExportMetadata -

func (*API) Health

func (api *API) Health() error

Health

func (*API) ReplaceMetadata

func (api *API) ReplaceMetadata(data interface{}) error

ReplaceMetadata -

func (*API) TrackTable added in v0.1.6

func (api *API) TrackTable(schema, name string) error

TrackTable -

type ExportMetadataResponse

type ExportMetadataResponse struct {
	Tables []map[string]interface{} `json:"tables"`
}

ExportMetadataResponse -

type Permission added in v0.1.8

type Permission struct {
	Columns   string      `json:"columns"`
	Limit     uint64      `json:"limit"`
	AllowAggs bool        `json:"allow_aggregations"`
	Filter    interface{} `json:"filter,omitempty"`
}

Permission -

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL