model

package
v0.0.0-...-4845449 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxCount     uint              = 10000             // 10k rows
	MaxTime      time.Duration     = 30 * time.Minute  // 30 min
	MaxSize      datasize.ByteSize = 100 * 1024 * 1024 // 100MB
	DefaultCount uint              = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Id string `json:"id"`
}

type Conditions

type Conditions struct {
	Count *uint
	Time  *time.Duration
	Size  *datasize.ByteSize
}

func NewConditions

func NewConditions() Conditions

func (*Conditions) Payload

func (c *Conditions) Payload() *webhooks.Conditions

func (*Conditions) SetCount

func (c *Conditions) SetCount(count *uint) error

func (*Conditions) SetSize

func (c *Conditions) SetSize(str *string) error

func (*Conditions) SetTime

func (c *Conditions) SetTime(str *string) error

func (*Conditions) ShouldImport

func (c *Conditions) ShouldImport(count uint, time time.Duration, size uint64) bool

type FileResource

type FileResource struct {
	Id           int    `json:"id" validate:"required"`
	Name         string `json:"name" validate:"required"`
	Url          string `json:"url" validate:"required"`
	Provider     string `json:"provider" validate:"required"`
	Region       string `json:"region" validate:"required"`
	UploadParams struct {
		Key         string `json:"key" validate:"required"`
		Bucket      string `json:"bucket" validate:"required"`
		Acl         string `json:"private" validate:"required"`
		Credentials struct {
			AccessKeyId     string `json:"accessKeyId" validate:"required"`
			SecretAccessKey string `json:"secretAccessKey" validate:"required"`
			SessionToken    string `json:"sessionToken" validate:"required"`
			Expiration      string `json:"expiration" validate:"required"`
		}
	}
}

FileResource .

type Job

type Job struct {
	Id      int                    `json:"id" validate:"required"`
	Error   JobError               `json:"error" validate:"required"`
	Status  string                 `json:"status" validate:"required"`
	Url     string                 `json:"url" validate:"required"`
	Results map[string]interface{} `json:"results"`
}

Job - Storage API job.

type JobError

type JobError struct {
	Message string `json:"message" validate:"required"`
}

type Row

type Row struct {
	Webhook uint32
	Time    time.Time `gorm:"not null"`
	Headers string    `gorm:"not null"`
	Body    string    `gorm:"not null"`
}

func (Row) TableName

func (Row) TableName() string

type Token

type Token struct {
	Id       string     `json:"id"`
	Token    string     `json:"token"`
	IsMaster bool       `json:"isMasterToken"`
	Owner    TokenOwner `json:"owner"`
}

Token https://keboola.docs.apiary.io/#reference/tokens-and-permissions/token-verification/token-verification

func (*Token) ProjectId

func (t *Token) ProjectId() int

func (*Token) ProjectName

func (t *Token) ProjectName() string

type TokenOwner

type TokenOwner struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type Webhook

type Webhook struct {
	Id         uint32      `gorm:"primaryKey;autoIncrement"`
	Hash       WebhookHash `gorm:"type:CHAR(21);index;not null"`
	ProjectId  uint32
	Token      string `gorm:"type:VARCHAR(255);not null"`
	TableId    string `gorm:"type:VARCHAR(1000);not null"`
	Size       uint64
	ImportedAt time.Time  `gorm:"not null"`
	Conditions Conditions `gorm:"embedded;embeddedPrefix:condition_"`
	Data       []Row      `gorm:"foreignKey:Webhook"` // only for FK definition
}

func (*Webhook) Url

func (v *Webhook) Url(host string) string

type WebhookHash

type WebhookHash string

Jump to

Keyboard shortcuts

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