migrations

package
v2.4.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 40 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Migration007_casesCreateSQL     = "" /* 351-byte string literal not displayed */
	Migration007_purchasesCreateSQL = "" /* 293-byte string literal not displayed */
	Migration007_salesCreateSQL     = "" /* 306-byte string literal not displayed */
)
View Source
const (
	Migration008_OrderState_PENDING          = 0
	Migration008_OrderState_AWAITING_PAYMENT = 1
	Migration008_OrderState_DISPUTED         = 10

	Migration008_casesCreateSQL     = "" /* 394-byte string literal not displayed */
	Migration008_purchasesCreateSQL = "" /* 336-byte string literal not displayed */
	Migration008_salesCreateSQL     = "" /* 349-byte string literal not displayed */
)
View Source
const (
	Migration009CreatePreviousCasesTable     = "" /* 407-byte string literal not displayed */
	Migration009CreatePreviousSalesTable     = "" /* 363-byte string literal not displayed */
	Migration009CreatePreviousSalesIndex     = "create index index_sales on sales (paymentAddr, timestamp);"
	Migration009CreatePreviousPurchasesTable = "" /* 445-byte string literal not displayed */
)
View Source
const (
	// MigrationCreateMessagesAM06MessagesCreateSQL the messages create sql
	MigrationCreateMessagesAM06MessagesCreateSQL = "" /* 207-byte string literal not displayed */
	// MigrationCreateMessagesAM06CreateIndexMessagesSQLMessageID the messages index on messageID sql
	MigrationCreateMessagesAM06CreateIndexMessagesSQLMessageID = "create index index_messages_messageID on messages (messageID);"
	// MigrationCreateMessagesAM06CreateIndexMessagesSQLOrderIDMType the messages composite index on orderID and messageType create sql
	MigrationCreateMessagesAM06CreateIndexMessagesSQLOrderIDMType = "create index index_messages_orderIDmType on messages (orderID, message_type);"
	// MigrationCreateMessagesAM06CreateIndexMessagesSQLPeerIDMType the messages composite index on peerID and messageType create sql
	MigrationCreateMessagesAM06CreateIndexMessagesSQLPeerIDMType = "create index index_messages_peerIDmType on messages (peerID, message_type);"
	// MigrationCreateMessagesAM06MessagesDeleteSQL the messages delete sql
	MigrationCreateMessagesAM06MessagesDeleteSQL = "drop table if exists messages;"
	// MigrationCreateMessagesAM06DeleteIndexMessagesSQLMessageID delete the messages index on messageID sql
	MigrationCreateMessagesAM06DeleteIndexMessagesSQLMessageID = "drop index if exists index_messages_messageID;"
	// MigrationCreateMessagesAM06DeleteIndexMessagesSQLOrderIDMType delete the messages composite index on orderID and messageType create sql
	MigrationCreateMessagesAM06DeleteIndexMessagesSQLOrderIDMType = "drop index if exists index_messages_orderIDmType;"
	// MigrationCreateMessagesAM06DeleteIndexMessagesSQLPeerIDMType delete the messages composite index on peerID and messageType create sql
	MigrationCreateMessagesAM06DeleteIndexMessagesSQLPeerIDMType = "drop index if exists index_messages_peerIDmType;"
	// MigrationCreateMessagesAM06UpVer set the repo Up version
	MigrationCreateMessagesAM06UpVer = "25"
	// MigrationCreateMessagesAM06DownVer set the repo Down version
	MigrationCreateMessagesAM06DownVer = "24"
)
View Source
const (

	// MigrationCreateMessagesAM09MessagesCreateSQLDown the messages create sql
	MigrationCreateMessagesAM09MessagesCreateSQLDown = "" /* 207-byte string literal not displayed */

)

Variables

View Source
var (
	Migration017PushToBefore = []string{
		"QmWbi8z4uPkEdrWHtgxCkQGE5vxJnrStXAeEQnupmQnKRh",
		"QmRh7fSZyFHesEL9aTmdxbrvMFxzyFxoaQGjYBotot6WLw",
		"QmZLs6zVpVtkoR8oYyAbCxujvC6weU5CgUPTYx8zKMAtTf",
	}

	Migration017PushToAfter = []string{
		"QmWbi8z4uPkEdrWHtgxCkQGE5vxJnrStXAeEQnupmQnKRh",
		"Qma2LRYB4xLaoxsMCL2kb93WKCW4EotUMhgvQUSqE6tCka",
		"QmZLs6zVpVtkoR8oYyAbCxujvC6weU5CgUPTYx8zKMAtTf",
		"QmNSnS2K3TkSQjxJhaRBSZxotUQp1yxLss4zKDVbhRc9nv",
	}
)
View Source
var (
	AM02_up_create_sales   = "" /* 404-byte string literal not displayed */
	AM02_down_create_sales = "" /* 407-byte string literal not displayed */
	AM02_temp_sales        = "ALTER TABLE sales RENAME TO temp_sales;"
	AM02_insert_sales      = "" /* 249-byte string literal not displayed */
	AM02_drop_temp_sales   = "DROP TABLE temp_sales;"

	AM02_up_update_purchases   = "update purchases set lastDisputeExpiryNotifiedAt = 0 where lastDisputeExpiryNotifiedAt is NULL;"
	AM02_up_create_purchases   = "" /* 505-byte string literal not displayed */
	AM02_down_create_purchases = "" /* 508-byte string literal not displayed */
	AM02_temp_purchases        = "ALTER TABLE purchases RENAME TO temp_purchases;"
	AM02_insert_purchases      = "" /* 300-byte string literal not displayed */
	AM02_drop_temp_purchases   = "DROP TABLE temp_purchases;"

	AM02_up_create_inventory   = "create table inventory (invID text primary key not null, slug text, variantIndex integer, count text);"
	AM02_down_create_inventory = "create table inventory (invID text primary key not null, slug text, variantIndex integer, count integer);"
	AM02_temp_inventory        = "ALTER TABLE inventory RENAME TO temp_inventory;"
	AM02_insert_inventory      = "INSERT INTO inventory SELECT invID, slug, variantIndex, count FROM temp_inventory;"
	AM02_drop_temp_inventory   = "DROP TABLE temp_inventory;"
)
View Source
var AM01DownVer = 32
View Source
var AM01UpVer = 33
View Source
var AM02DownVer = "29"
View Source
var AM02UpVer = "30"
View Source
var SwarmKeyData = []byte("/key/swarm/psk/1.0.0/\n/base16/\n59468cfd4d4dc2a61395080513e853434d0313495f34be65c18d643d09eafe6f")

Functions

func AM01_updateRecords added in v0.14.0

func AM01_updateRecords(tx *sql.Tx, records []AM01_record, query string, testMode bool, migrateDown bool) error

func IPNSKeysForID added in v0.13.1

func IPNSKeysForID(id peer.ID) (name, ipns string)

func MakePutRecord added in v0.13.1

func MakePutRecord(sk ci.PrivKey, key string, value []byte, sign bool) (*dhtpb.Migration020RecordOldFormat, error)

MakePutRecord creates and signs a dht record for the given key/value pair

func Migration012_GetIdentityKey added in v0.12.3

func Migration012_GetIdentityKey(repoPath, databasePassword string, testnetEnabled bool) ([]byte, error)

func Migration012_listingHasNewFeaturesAndOldVersion added in v0.12.3

func Migration012_listingHasNewFeaturesAndOldVersion(sl *pb.SignedListing) bool

func Migration013_AddressToScript added in v0.12.4

func Migration013_AddressToScript(coinType string, addr string, testmodeEnanabled bool) ([]byte, error)

func Migration013_ChainConfigParams added in v0.12.4

func Migration013_ChainConfigParams(testnet bool) *chaincfg.Params

func Migration013_ScriptToAddress added in v0.12.4

func Migration013_ScriptToAddress(coinType string, script []byte, testmodeEnanabled bool) (string, error)

func OpenDB added in v0.12.1

func OpenDB(repoPath string, dbPassword string, testnet bool) (*sql.DB, error)

func RecordBlobForSig added in v0.13.1

func RecordBlobForSig(r *dhtpb.Migration020RecordOldFormat) []byte

RecordBlobForSig returns the blob protected by the record signature

Types

type AM01 added in v0.14.0

type AM01 struct{}

AM01 migrates the listing and order data to use higher precision.

func (AM01) Down added in v0.14.0

func (AM01) Down(repoPath string, dbPassword string, testnet bool) (err error)

func (AM01) Up added in v0.14.0

func (AM01) Up(repoPath string, dbPassword string, testnet bool) (err error)

type AM01_TransactionRecord_afterMigration added in v0.14.0

type AM01_TransactionRecord_afterMigration struct {
	Txid      string
	Index     uint32
	Value     big.Int
	Address   string
	Spent     bool
	Timestamp time.Time
}

type AM01_TransactionRecord_beforeMigration added in v0.14.0

type AM01_TransactionRecord_beforeMigration struct {
	Txid      string
	Index     uint32
	Value     int64
	Address   string
	Spent     bool
	Timestamp time.Time
}

type AM01_record added in v0.14.0

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

func AM01_extractRecords added in v0.14.0

func AM01_extractRecords(db *sql.DB, query string, migrateDown bool) ([]AM01_record, error)

type AM02 added in v0.14.0

type AM02 struct{}

func (AM02) Down added in v0.14.0

func (AM02) Down(repoPath string, dbPassword string, testnet bool) error

func (AM02) Up added in v0.14.0

func (AM02) Up(repoPath string, dbPassword string, testnet bool) error

type AM03 added in v0.14.0

type AM03 struct{}

func (AM03) Down added in v0.14.0

func (AM03) Down(repoPath string, dbPassword string, testnet bool) error

func (AM03) Up added in v0.14.0

func (AM03) Up(repoPath string, dbPassword string, testnet bool) error

type ListingData added in v0.13.1

type ListingData struct {
	Hash               string    `json:"hash"`
	Slug               string    `json:"slug"`
	Title              string    `json:"title"`
	Categories         []string  `json:"categories"`
	NSFW               bool      `json:"nsfw"`
	ContractType       string    `json:"contractType"`
	Description        string    `json:"description"`
	Thumbnail          thumbnail `json:"thumbnail"`
	Price              price     `json:"price"`
	ShipsTo            []string  `json:"shipsTo"`
	FreeShipping       []string  `json:"freeShipping"`
	Language           string    `json:"language"`
	AverageRating      float32   `json:"averageRating"`
	RatingCount        uint32    `json:"ratingCount"`
	ModeratorIDs       []string  `json:"moderators"`
	AcceptedCurrencies []string  `json:"acceptedCurrencies"`
	CoinType           string    `json:"coinType"`
}

type MigrateListingsToV5Schema_ListingThumbnail added in v0.14.0

type MigrateListingsToV5Schema_ListingThumbnail struct {
	Tiny   string `json:"tiny"`
	Small  string `json:"small"`
	Medium string `json:"medium"`
}

type MigrateListingsToV5Schema_V4ListingIndexData added in v0.14.0

type MigrateListingsToV5Schema_V4ListingIndexData struct {
	Hash               string                                     `json:"hash"`
	Slug               string                                     `json:"slug"`
	Title              string                                     `json:"title"`
	Categories         []string                                   `json:"categories"`
	NSFW               bool                                       `json:"nsfw"`
	ContractType       string                                     `json:"contractType"`
	Description        string                                     `json:"description"`
	Thumbnail          MigrateListingsToV5Schema_ListingThumbnail `json:"thumbnail"`
	Price              MigrateListingsToV5Schema_V4price          `json:"price"`
	ShipsTo            []string                                   `json:"shipsTo"`
	FreeShipping       []string                                   `json:"freeShipping"`
	Language           string                                     `json:"language"`
	AverageRating      float32                                    `json:"averageRating"`
	RatingCount        uint32                                     `json:"ratingCount"`
	ModeratorIDs       []string                                   `json:"moderators"`
	AcceptedCurrencies []string                                   `json:"acceptedCurrencies"`
	CryptoCurrencyCode string                                     `json:"coinType"`
}

type MigrateListingsToV5Schema_V4price added in v0.14.0

type MigrateListingsToV5Schema_V4price struct {
	CurrencyCode string  `json:"currencyCode"`
	Amount       uint    `json:"amount"`
	Modifier     float32 `json:"modifier"`
}

type MigrateListingsToV5Schema_V5CurrencyCode added in v0.14.0

type MigrateListingsToV5Schema_V5CurrencyCode string

type MigrateListingsToV5Schema_V5CurrencyDefinition added in v0.14.0

type MigrateListingsToV5Schema_V5CurrencyDefinition struct {
	Code         MigrateListingsToV5Schema_V5CurrencyCode `json:"code"`
	Divisibility uint                                     `json:"divisibility"`
}

type MigrateListingsToV5Schema_V5CurrencyValue added in v0.14.0

type MigrateListingsToV5Schema_V5CurrencyValue struct {
	Amount   *big.Int                                       `json:"amount"`
	Currency MigrateListingsToV5Schema_V5CurrencyDefinition `json:"currency"`
}

func (*MigrateListingsToV5Schema_V5CurrencyValue) MarshalJSON added in v0.14.0

func (*MigrateListingsToV5Schema_V5CurrencyValue) UnmarshalJSON added in v0.14.0

type MigrateListingsToV5Schema_V5ListingIndexData added in v0.14.0

type MigrateListingsToV5Schema_V5ListingIndexData struct {
	Hash               string                                     `json:"hash"`
	Slug               string                                     `json:"slug"`
	Title              string                                     `json:"title"`
	Categories         []string                                   `json:"categories"`
	NSFW               bool                                       `json:"nsfw"`
	ContractType       string                                     `json:"contractType"`
	Description        string                                     `json:"description"`
	Thumbnail          MigrateListingsToV5Schema_ListingThumbnail `json:"thumbnail"`
	Price              *MigrateListingsToV5Schema_V5CurrencyValue `json:"price"`
	Modifier           float32                                    `json:"modifier"`
	ShipsTo            []string                                   `json:"shipsTo"`
	FreeShipping       []string                                   `json:"freeShipping"`
	Language           string                                     `json:"language"`
	AverageRating      float32                                    `json:"averageRating"`
	RatingCount        uint32                                     `json:"ratingCount"`
	ModeratorIDs       []string                                   `json:"moderators"`
	AcceptedCurrencies []string                                   `json:"acceptedCurrencies"`
	CryptoCurrencyCode string                                     `json:"coinType"`
}

type Migration000

type Migration000 struct{}

func (Migration000) Down added in v0.11.1

func (Migration000) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration000) Up added in v0.11.1

func (Migration000) Up(repoPath string, dbPassword string, testnet bool) error

type Migration001 added in v0.9.3

type Migration001 struct{}

func (Migration001) Down added in v0.11.1

func (Migration001) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration001) Up added in v0.11.1

func (Migration001) Up(repoPath string, dbPassword string, testnet bool) error

type Migration002 added in v0.9.3

type Migration002 struct{}

func (Migration002) Down added in v0.11.1

func (Migration002) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration002) Up added in v0.11.1

func (Migration002) Up(repoPath string, dbPassword string, testnet bool) error

type Migration003 added in v0.9.3

type Migration003 struct{}

func (Migration003) Down added in v0.11.1

func (Migration003) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration003) Up added in v0.11.1

func (Migration003) Up(repoPath string, dbPassword string, testnet bool) error

type Migration004 added in v0.9.4

type Migration004 struct{}

func (Migration004) Down added in v0.11.1

func (Migration004) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration004) Up added in v0.11.1

func (Migration004) Up(repoPath string, dbPassword string, testnet bool) error

type Migration005 added in v0.11.0

type Migration005 struct{}

func (Migration005) Down added in v0.11.1

func (Migration005) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration005) Up added in v0.11.1

func (Migration005) Up(repoPath string, dbPassword string, testnet bool) error

type Migration006 added in v0.11.1

type Migration006 struct{}

func (Migration006) Down added in v0.11.1

func (Migration006) Down(repoPath, databasePassword string, testnetEnabled bool) error

func (Migration006) Up added in v0.11.1

func (Migration006) Up(repoPath, databasePassword string, testnetEnabled bool) error

type Migration006_configRecord added in v0.12.1

type Migration006_configRecord struct {
	StoreModerators []string `json:"storeModerators"`
}

type Migration006_listingDataAfterMigration added in v0.12.1

type Migration006_listingDataAfterMigration struct {
	Hash          string                 `json:"hash"`
	Slug          string                 `json:"slug"`
	Title         string                 `json:"title"`
	Categories    []string               `json:"categories"`
	NSFW          bool                   `json:"nsfw"`
	ContractType  string                 `json:"contractType"`
	Description   string                 `json:"description"`
	Thumbnail     Migration006_thumbnail `json:"thumbnail"`
	Price         Migration006_price     `json:"price"`
	ShipsTo       []string               `json:"shipsTo"`
	FreeShipping  []string               `json:"freeShipping"`
	Language      string                 `json:"language"`
	AverageRating float32                `json:"averageRating"`
	RatingCount   uint32                 `json:"ratingCount"`

	// Adding ModeratorIDs
	ModeratorIDs []string `json:"moderators"`
}

type Migration006_listingDataBeforeMigration added in v0.12.1

type Migration006_listingDataBeforeMigration struct {
	Hash          string                 `json:"hash"`
	Slug          string                 `json:"slug"`
	Title         string                 `json:"title"`
	Categories    []string               `json:"categories"`
	NSFW          bool                   `json:"nsfw"`
	ContractType  string                 `json:"contractType"`
	Description   string                 `json:"description"`
	Thumbnail     Migration006_thumbnail `json:"thumbnail"`
	Price         Migration006_price     `json:"price"`
	ShipsTo       []string               `json:"shipsTo"`
	FreeShipping  []string               `json:"freeShipping"`
	Language      string                 `json:"language"`
	AverageRating float32                `json:"averageRating"`
	RatingCount   uint32                 `json:"ratingCount"`
}

type Migration006_price added in v0.12.1

type Migration006_price struct {
	CurrencyCode string `json:"currencyCode"`
	Amount       uint64 `json:"amount"`
}

type Migration006_thumbnail added in v0.12.1

type Migration006_thumbnail struct {
	Tiny   string `json:"tiny"`
	Small  string `json:"small"`
	Medium string `json:"medium"`
}

type Migration007 added in v0.12.1

type Migration007 struct{}

func (Migration007) Down added in v0.12.1

func (Migration007) Down(repoPath, databasePassword string, testnetEnabled bool) error

func (Migration007) Up added in v0.12.1

func (Migration007) Up(repoPath, databasePassword string, testnetEnabled bool) error

type Migration008 added in v0.12.1

type Migration008 struct{}

func (Migration008) Down added in v0.12.1

func (Migration008) Down(repoPath, databasePassword string, testnetEnabled bool) error

func (Migration008) Up added in v0.12.1

func (Migration008) Up(repoPath, databasePassword string, testnetEnabled bool) error

type Migration009 added in v0.12.1

type Migration009 struct{}

func (Migration009) Down added in v0.12.1

func (Migration009) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration009) Up added in v0.12.1

func (Migration009) Up(repoPath string, dbPassword string, testnet bool) (err error)

type Migration009_listing added in v0.12.1

type Migration009_listing struct {
	Listing Migration009_listing_listing `json:"listing"`
}

type Migration009_listingDataAfterMigration added in v0.12.1

type Migration009_listingDataAfterMigration struct {
	Hash          string                 `json:"hash"`
	Slug          string                 `json:"slug"`
	Title         string                 `json:"title"`
	Categories    []string               `json:"categories"`
	NSFW          bool                   `json:"nsfw"`
	CoinType      string                 `json:"coinType"`
	ContractType  string                 `json:"contractType"`
	Description   string                 `json:"description"`
	Thumbnail     Migration009_thumbnail `json:"thumbnail"`
	Price         Migration009_price     `json:"price"`
	ShipsTo       []string               `json:"shipsTo"`
	FreeShipping  []string               `json:"freeShipping"`
	Language      string                 `json:"language"`
	AverageRating float32                `json:"averageRating"`
	RatingCount   uint32                 `json:"ratingCount"`
	ModeratorIDs  []string               `json:"moderators"`

	// Adding AcceptedCurrencies
	AcceptedCurrencies []string `json:"acceptedCurrencies"`
}

type Migration009_listingDataBeforeMigration added in v0.12.1

type Migration009_listingDataBeforeMigration struct {
	Hash          string                 `json:"hash"`
	Slug          string                 `json:"slug"`
	Title         string                 `json:"title"`
	Categories    []string               `json:"categories"`
	NSFW          bool                   `json:"nsfw"`
	CoinType      string                 `json:"coinType"`
	ContractType  string                 `json:"contractType"`
	Description   string                 `json:"description"`
	Thumbnail     Migration009_thumbnail `json:"thumbnail"`
	Price         Migration009_price     `json:"price"`
	ShipsTo       []string               `json:"shipsTo"`
	FreeShipping  []string               `json:"freeShipping"`
	Language      string                 `json:"language"`
	AverageRating float32                `json:"averageRating"`
	RatingCount   uint32                 `json:"ratingCount"`
	ModeratorIDs  []string               `json:"moderators"`
}

type Migration009_listing_listing added in v0.12.1

type Migration009_listing_listing struct {
	Metadata Migration009_listing_listing_metadata `json:"metadata"`
}

type Migration009_listing_listing_metadata added in v0.12.1

type Migration009_listing_listing_metadata struct {
	AcceptedCurrencies []string `json:"acceptedCurrencies"`
}

type Migration009_price added in v0.12.1

type Migration009_price struct {
	CurrencyCode string `json:"currencyCode"`
	Amount       uint64 `json:"amount"`
}

type Migration009_thumbnail added in v0.12.1

type Migration009_thumbnail struct {
	Tiny   string `json:"tiny"`
	Small  string `json:"small"`
	Medium string `json:"medium"`
}

type Migration010 added in v0.12.1

type Migration010 struct{}

func (Migration010) Down added in v0.12.1

func (Migration010) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration010) Up added in v0.12.1

func (Migration010) Up(repoPath string, dbPassword string, testnet bool) (err error)

type Migration011 added in v0.12.3

type Migration011 struct{}

func (Migration011) Down added in v0.12.3

func (Migration011) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration011) Up added in v0.12.3

func (Migration011) Up(repoPath string, dbPassword string, testnet bool) error

type Migration011_listing added in v0.12.3

type Migration011_listing struct {
	Listing Migration011_listing_listing `json:"listing"`
}

type Migration011_listing_listing added in v0.12.3

type Migration011_listing_listing struct {
	ModeratorIDs []string `json:"moderators"`
}

type Migration012 added in v0.12.3

type Migration012 struct{}

func (Migration012) Down added in v0.12.3

func (Migration012) Down(repoPath, databasePassword string, testnetEnabled bool) error

func (Migration012) Up added in v0.12.3

func (Migration012) Up(repoPath, databasePassword string, testnetEnabled bool) error

type Migration012_ListingData added in v0.12.3

type Migration012_ListingData struct {
	Hash         string   `json:"hash"`
	Slug         string   `json:"slug"`
	Title        string   `json:"title"`
	Categories   []string `json:"categories"`
	NSFW         bool     `json:"nsfw"`
	ContractType string   `json:"contractType"`
	Description  string   `json:"description"`
	Thumbnail    struct {
		Tiny   string `json:"tiny"`
		Small  string `json:"small"`
		Medium string `json:"medium"`
	} `json:"thumbnail"`
	Price struct {
		CurrencyCode string  `json:"currencyCode"`
		Amount       uint64  `json:"amount"`
		Modifier     float32 `json:"modifier"`
	} `json:"price"`
	ShipsTo            []string `json:"shipsTo"`
	FreeShipping       []string `json:"freeShipping"`
	Language           string   `json:"language"`
	AverageRating      float32  `json:"averageRating"`
	RatingCount        uint32   `json:"ratingCount"`
	ModeratorIDs       []string `json:"moderators"`
	AcceptedCurrencies []string `json:"acceptedCurrencies"`
	CoinType           string   `json:"coinType"`
}

type Migration013 added in v0.12.4

type Migration013 struct{}

func (Migration013) Down added in v0.12.4

func (Migration013) Down(repoPath string, dbPassword string, testnet bool) (err error)

func (Migration013) Up added in v0.12.4

func (Migration013) Up(repoPath string, dbPassword string, testnet bool) (err error)

type Migration013_TransactionRecord_afterMigration added in v0.12.4

type Migration013_TransactionRecord_afterMigration struct {
	Txid      string
	Index     uint32
	Value     int64
	Address   string
	Spent     bool
	Timestamp time.Time
}

type Migration013_TransactionRecord_beforeMigration added in v0.12.4

type Migration013_TransactionRecord_beforeMigration struct {
	Txid         string
	Index        uint32
	Value        int64
	ScriptPubKey string
	Spent        bool
	Timestamp    time.Time
}

type Migration014 added in v0.12.4

type Migration014 struct{}

Migration014 is deprecated to remove support for bitcoind and zcashd runtime dependencies. The migration behavior is intact for historical purposes.

func (Migration014) Down added in v0.12.4

func (Migration014) Down(_, _ string, _ bool) error

func (Migration014) Up added in v0.12.4

func (Migration014) Up(_, _ string, _ bool) error

type Migration015 added in v0.13.0

type Migration015 struct{}

func (Migration015) Down added in v0.13.0

func (Migration015) Down(repoPath, dbPassword string, testnet bool) error

func (Migration015) Up added in v0.13.0

func (Migration015) Up(repoPath, dbPassword string, testnet bool) error

type Migration016 added in v0.13.0

type Migration016 struct{}

func (Migration016) Down added in v0.13.0

func (Migration016) Down(repoPath, dbPassword string, testnet bool) error

func (Migration016) Up added in v0.13.0

func (Migration016) Up(repoPath, dbPassword string, testnet bool) error

type Migration016WalletsConfig added in v0.13.0

type Migration016WalletsConfig struct {
	PHR *migration016CoinConfig `json:"PHR"`
	BTC *migration016CoinConfig `json:"BTC"`
	BCH *migration016CoinConfig `json:"BCH"`
	LTC *migration016CoinConfig `json:"LTC"`
	ZEC *migration016CoinConfig `json:"ZEC"`
	ETH *migration016CoinConfig `json:"ETH"`
}

type Migration017 added in v0.13.0

type Migration017 struct{}

func (Migration017) Down added in v0.13.0

func (Migration017) Down(repoPath, dbPassword string, testnet bool) error

func (Migration017) Up added in v0.13.0

func (Migration017) Up(repoPath, dbPassword string, testnet bool) error

type Migration018 added in v0.13.1

type Migration018 struct{}

Migration018 migrates the config file to be compatible with the latest version of IPFS. We've also removed the resolvers config as we aren't using that any more and added an IpnsExtra config which contains fields we previously patched into the IPNS config.

func (Migration018) Down added in v0.13.1

func (Migration018) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration018) Up added in v0.13.1

func (Migration018) Up(repoPath string, dbPassword string, testnet bool) error

type Migration019 added in v0.13.1

type Migration019 struct{}

Migration019 migrates the listing index file to use the new style (Qm) hashes for listings rather than the old CID (z) style hashes.

func (Migration019) Down added in v0.13.1

func (Migration019) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration019) Up added in v0.13.1

func (Migration019) Up(repoPath string, dbPassword string, testnet bool) error

type Migration020 added in v0.13.1

type Migration020 struct{}

Migration020 runs an IPFS migration which migrates the IPNS records in the datastore.

func (Migration020) Down added in v0.13.1

func (Migration020) Down(repoPath string, dbPassword string, testnet bool) error

func (Migration020) Up added in v0.13.1

func (Migration020) Up(repoPath string, dbPassword string, testnet bool) error

type Migration021 added in v0.13.3

type Migration021 struct{}

Migration021 migrates the config file to set the Swarm: EnableAutoRelay option to true.

func (Migration021) Down added in v0.13.3

func (Migration021) Down(repoPath, dbPassword string, testnet bool) error

func (Migration021) Up added in v0.13.3

func (Migration021) Up(repoPath, dbPassword string, testnet bool) error

type Migration022 added in v0.13.3

type Migration022 struct{}

Migration022 migrates the config file to set the IPNSExtra: APIRouter option in the config file. Also deletes IPNSExtra: FallbackAPI if it exists.

func (Migration022) Down added in v0.13.3

func (Migration022) Down(repoPath, dbPassword string, testnet bool) error

func (Migration022) Up added in v0.13.3

func (Migration022) Up(repoPath, dbPassword string, testnet bool) error

type Migration023 added in v0.13.5

type Migration023 struct{}

func (Migration023) Down added in v0.13.5

func (Migration023) Down(repoPath, databasePassword string, testnetEnabled bool) error

func (Migration023) Up added in v0.13.5

func (Migration023) Up(repoPath, databasePassword string, testnetEnabled bool) error

type Migration023_ChatMessage added in v0.13.5

type Migration023_ChatMessage struct {
	MessageId string
	PeerId    string
	Subject   string
	Message   string
	Read      bool
	Outgoing  bool
	Timestamp time.Time
}

type Migration024 added in v0.13.5

type Migration024 struct {
	MigrationCreateMessagesAM06
}

Migration024 migration struct

type Migration025 added in v0.13.5

type Migration025 struct{}

func (Migration025) Down added in v0.13.5

func (Migration025) Down(repoPath, databasePassword string, testnetEnabled bool) error

func (Migration025) Up added in v0.13.5

func (Migration025) Up(repoPath, databasePassword string, testnetEnabled bool) error

type Migration026 added in v0.13.6

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

func (Migration026) Down added in v0.13.6

func (Migration026) Down(repoPath, databasePassword string, testnetEnabled bool) error

func (Migration026) Up added in v0.13.6

func (Migration026) Up(repoPath, databasePassword string, testnetEnabled bool) error

Should we ever update these packages (which functionally changes their behavior) the migrations should be made into a no-op.

type Migration027 added in v0.14.0

type Migration027 struct{ UpdateListingHash }

type Migration028 added in v0.14.0

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

func (Migration028) Down added in v0.14.0

func (Migration028) Down(repoPath, databasePassword string, testnetEnabled bool) error

func (Migration028) Up added in v0.14.0

func (Migration028) Up(repoPath, databasePassword string, testnetEnabled bool) error

type Migration029 added in v0.13.5

type Migration029 struct{ AM02 }

type Migration030 added in v0.14.0

type Migration030 struct{ AM03 }

type Migration031 added in v0.14.0

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

func (Migration031) Down added in v0.14.0

func (Migration031) Down(repoPath, dbPassword string, testnet bool) error

Down - downgrade/restore the state

func (Migration031) Up added in v0.14.0

func (Migration031) Up(repoPath, dbPassword string, testnet bool) error

Up - upgrade the state

type Migration032 added in v0.14.0

type Migration032 struct {
	AM01
}

type Migration033 added in v0.14.0

type Migration033 struct{}

Migration033 migration struct

func (Migration033) Down added in v0.14.0

func (Migration033) Down(repoPath, databasePassword string, testnetEnabled bool) error

Down the migration Down code

func (Migration033) Up added in v0.14.0

func (Migration033) Up(repoPath, databasePassword string, testnetEnabled bool) error

Up the migration Up code

type MigrationCreateMessagesAM06 added in v0.13.5

type MigrationCreateMessagesAM06 struct{}

MigrationCreateMessagesAM06 local migration struct

func (MigrationCreateMessagesAM06) Down added in v0.13.5

func (MigrationCreateMessagesAM06) Down(repoPath, databasePassword string, testnetEnabled bool) error

Down the migration Down code

func (MigrationCreateMessagesAM06) Up added in v0.13.5

func (MigrationCreateMessagesAM06) Up(repoPath, databasePassword string, testnetEnabled bool) error

Up the migration Up code

type UpdateListingHash added in v0.14.0

type UpdateListingHash struct{}

UpdateListingHash will update the hashes of each listing in the listing index with the newest hash format.

func (UpdateListingHash) Down added in v0.14.0

func (UpdateListingHash) Down(repoPath, databasePassword string, testnetEnabled bool) error

func (UpdateListingHash) Up added in v0.14.0

func (UpdateListingHash) Up(repoPath, databasePassword string, testnetEnabled bool) error

type UpdateListingHash_ListingData added in v0.14.0

type UpdateListingHash_ListingData struct {
	Hash               string                      `json:"hash"`
	Slug               string                      `json:"slug"`
	Title              string                      `json:"title"`
	Categories         []string                    `json:"categories"`
	NSFW               bool                        `json:"nsfw"`
	ContractType       string                      `json:"contractType"`
	Description        string                      `json:"description"`
	Thumbnail          UpdateListingHash_Thumbnail `json:"thumbnail"`
	Price              UpdateListingHash_Price     `json:"price"`
	ShipsTo            []string                    `json:"shipsTo"`
	FreeShipping       []string                    `json:"freeShipping"`
	Language           string                      `json:"language"`
	AverageRating      float32                     `json:"averageRating"`
	RatingCount        uint32                      `json:"ratingCount"`
	ModeratorIDs       []string                    `json:"moderators"`
	AcceptedCurrencies []string                    `json:"acceptedCurrencies"`
	CoinType           string                      `json:"coinType"`
}

type UpdateListingHash_Price added in v0.14.0

type UpdateListingHash_Price struct {
	CurrencyCode string  `json:"currencyCode"`
	Amount       uint64  `json:"amount"`
	Modifier     float32 `json:"modifier"`
}

type UpdateListingHash_Thumbnail added in v0.14.0

type UpdateListingHash_Thumbnail struct {
	Tiny   string `json:"tiny"`
	Small  string `json:"small"`
	Medium string `json:"medium"`
}

Directories

Path Synopsis
helpers

Jump to

Keyboard shortcuts

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