model

package
v0.0.0-...-39b8527 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim

type Claim struct {
	ID                  uint64                 `json:"id,omitempty"`
	Name                string                 `json:"name,omitempty"`
	StrippedName        string                 `json:"stripped_name,omitempty"`
	ClaimID             string                 `json:"claimId,omitempty"`
	Channel             *null.String           `json:"channel,omitempty"`
	ChannelClaimID      *null.String           `json:"channel_claim_id,omitempty"`
	BidState            string                 `json:"bid_state,omitempty"`
	EffectiveAmount     uint64                 `json:"effective_amount,omitempty"`
	TransactionTimeUnix null.Uint64            `json:"-"` //Could be null in mempool
	TransactionTime     *null.Time             `json:"transaction_time,omitempty"`
	CQCreatedAt         *null.Time             `json:"cq_created_at,omitempty"`
	CertificateAmount   uint64                 `json:"certificate_amount,omitempty"`
	JSONValue           null.String            `json:"-"`
	Value               map[string]interface{} `json:"value,omitempty"`
	Title               *null.String           `json:"title,omitempty"`
	Description         *null.String           `json:"description,omitempty"`
	ReleaseTimeUnix     null.Uint64            `json:"-"`
	ReleaseTime         *null.Time             `json:"release_time,omitempty"`
	ContentType         *null.String           `json:"content_type,omitempty"`
	CertValid           bool                   `json:"cert_valid,omitempty"`
	ClaimType           *null.String           `json:"claim_type,omitempty"`
	FrameWidth          *null.Uint64           `json:"frame_width,omitempty"`
	FrameHeight         *null.Uint64           `json:"frame_height,omitempty"`
	Duration            *null.Uint64           `json:"duration,omitempty"`
	NSFW                bool                   `json:"nsfw,omitempty"`
	ViewCnt             *null.Uint64           `json:"view_cnt,omitempty"`
	SubCnt              *null.Uint64           `json:"sub_cnt,omitempty"`
	ThumbnailURL        *null.String           `json:"thumbnail_url,omitempty"`
	Fee                 *null.Float64          `json:"fee,omitempty"`
	TagsStr             *null.String           `json:"-"`
	Tags                []string               `json:"tags,omitempty"`
	ClaimCount          uint64                 `json:"claim_cnt,omitempty"`
	ChannelClaimCount   *null.Uint64           `json:"channel_claim_count,omitempty"`
	IOSFiltered         bool                   `json:"ios_filtered,omitempty"`
	Language            *null.String           `json:"language,omitempty"`
}

Claim is the document type specified as a struct stored in elasticsearch

func GetClaimsFromDBRows

func GetClaimsFromDBRows(rows *sql.Rows) ([]Claim, int, error)

GetClaimsFromDBRows returns the claims from Chainquery DB.

func NewClaim

func NewClaim() Claim

NewClaim creates an instance of Claim with default values for pointers.

func (Claim) Add

func (c Claim) Add(p *elastic.BulkProcessor)

Add Inserts the claim as a document via the bulk processor into elasticsearch

func (Claim) AsJSON

func (c Claim) AsJSON() string

AsJSON converts the object into a json string

func (Claim) Delete

func (c Claim) Delete(p *elastic.BulkProcessor)

Delete removes the claim via the bulk processor from elasticsearch

func (*Claim) PopulateFromDB

func (c *Claim) PopulateFromDB(rows *sql.Rows) error

PopulateFromDB populates the data from the rows into claim objects

func (*Claim) ProcessFilters

func (c *Claim) ProcessFilters()

ProcessFilters sets the filter booleans that apply for the data

func (Claim) Update

func (c Claim) Update(p *elastic.BulkProcessor)

Update updates just the fields modified or with default values via the bulk processor in elasticsearch

Jump to

Keyboard shortcuts

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