Documentation ¶
Index ¶
- Constants
- type NewStoreOptions
- type Store
- func (store *Store) AutoMigrate() error
- func (store *Store) DB() *sql.DB
- func (st *Store) EnableDebug(debug bool)
- func (store *Store) VisitorCount(ctx context.Context, options VisitorQueryOptions) (int64, error)
- func (store *Store) VisitorCreate(ctx context.Context, visitor VisitorInterface) error
- func (store *Store) VisitorDelete(ctx context.Context, visitor VisitorInterface) error
- func (store *Store) VisitorDeleteByID(ctx context.Context, id string) error
- func (store *Store) VisitorFindByID(ctx context.Context, id string) (VisitorInterface, error)
- func (store *Store) VisitorList(ctx context.Context, options VisitorQueryOptions) ([]VisitorInterface, error)
- func (store *Store) VisitorRegister(ctx context.Context, r *http.Request) error
- func (store *Store) VisitorSoftDelete(ctx context.Context, visitor VisitorInterface) error
- func (store *Store) VisitorSoftDeleteByID(ctx context.Context, id string) error
- func (store *Store) VisitorUpdate(ctx context.Context, visitor VisitorInterface) error
- type StoreInterface
- type Visitor
- func (visitor *Visitor) Country() string
- func (visitor *Visitor) CreatedAt() string
- func (visitor *Visitor) CreatedAtCarbon() carbon.Carbon
- func (visitor *Visitor) DeletedAt() string
- func (visitor *Visitor) DeletedAtCarbon() carbon.Carbon
- func (visitor *Visitor) Fingerprint() string
- func (visitor *Visitor) FingerprintCalculate() string
- func (visitor *Visitor) ID() string
- func (visitor *Visitor) IpAddress() string
- func (visitor *Visitor) Path() string
- func (visitor *Visitor) SetCountry(country string) VisitorInterface
- func (visitor *Visitor) SetCreatedAt(createdAt string) VisitorInterface
- func (visitor *Visitor) SetDeletedAt(deletedAt string) VisitorInterface
- func (visitor *Visitor) SetFingerprint(fingerprint string) VisitorInterface
- func (visitor *Visitor) SetID(id string) VisitorInterface
- func (visitor *Visitor) SetIpAddress(ipAddress string) VisitorInterface
- func (visitor *Visitor) SetPath(path string) VisitorInterface
- func (visitor *Visitor) SetUpdatedAt(updatedAt string) VisitorInterface
- func (visitor *Visitor) SetUserAcceptEncoding(userAcceptEncoding string) VisitorInterface
- func (visitor *Visitor) SetUserAcceptLanguage(userAcceptLanguage string) VisitorInterface
- func (visitor *Visitor) SetUserAgent(userAgent string) VisitorInterface
- func (visitor *Visitor) SetUserBrowser(userBrowser string) VisitorInterface
- func (visitor *Visitor) SetUserBrowserVersion(userBrowserVersion string) VisitorInterface
- func (visitor *Visitor) SetUserDevice(userDevice string) VisitorInterface
- func (visitor *Visitor) SetUserDeviceType(userDeviceType string) VisitorInterface
- func (visitor *Visitor) SetUserOs(userOs string) VisitorInterface
- func (visitor *Visitor) SetUserOsVersion(userOsVersion string) VisitorInterface
- func (visitor *Visitor) SetUserReferrer(userReferrer string) VisitorInterface
- func (visitor *Visitor) UpdatedAt() string
- func (visitor *Visitor) UpdatedAtCarbon() carbon.Carbon
- func (visitor *Visitor) UserAcceptEncoding() string
- func (visitor *Visitor) UserAcceptLanguage() string
- func (visitor *Visitor) UserAgent() string
- func (visitor *Visitor) UserBrowser() string
- func (visitor *Visitor) UserBrowserVersion() string
- func (visitor *Visitor) UserDevice() string
- func (visitor *Visitor) UserDeviceType() string
- func (visitor *Visitor) UserOs() string
- func (visitor *Visitor) UserOsVersion() string
- func (visitor *Visitor) UserReferrer() string
- type VisitorInterface
- type VisitorQueryOptions
Constants ¶
View Source
const COLUMN_COUNTRY = "country"
View Source
const COLUMN_CREATED_AT = "created_at"
View Source
const COLUMN_DELETED_AT = "deleted_at"
View Source
const COLUMN_FINGERPRINT = "fingerprint"
View Source
const COLUMN_ID = "id"
View Source
const COLUMN_IP_ADDRESS = "ip_address"
View Source
const COLUMN_PATH = "path"
View Source
const COLUMN_UPDATED_AT = "updated_at"
View Source
const COLUMN_USER_ACCEPT_ENCODING = "user_accept_encoding"
View Source
const COLUMN_USER_ACCEPT_LANGUAGE = "user_accept_language"
View Source
const COLUMN_USER_AGENT = "user_agent"
View Source
const COLUMN_USER_BROWSER = "user_browser"
View Source
const COLUMN_USER_BROWSER_VERSION = "user_browser_version"
View Source
const COLUMN_USER_DEVICE = "user_device"
View Source
const COLUMN_USER_DEVICE_TYPE = "user_device_type"
View Source
const COLUMN_USER_OS = "user_os"
View Source
const COLUMN_USER_OS_VERSION = "user_os_version"
View Source
const COLUMN_USER_REFERRER = "user_referrer"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NewStoreOptions ¶
type NewStoreOptions struct { VisitorTableName string DB *sql.DB DbDriverName string AutomigrateEnabled bool DebugEnabled bool }
NewStoreOptions define the options for creating a new block store
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶
func NewStore(opts NewStoreOptions) (*Store, error)
NewStore creates a new block store
func (*Store) EnableDebug ¶
EnableDebug - enables the debug option
func (*Store) VisitorCount ¶
func (*Store) VisitorCreate ¶
func (store *Store) VisitorCreate(ctx context.Context, visitor VisitorInterface) error
func (*Store) VisitorDelete ¶
func (store *Store) VisitorDelete(ctx context.Context, visitor VisitorInterface) error
func (*Store) VisitorDeleteByID ¶
func (*Store) VisitorFindByID ¶
func (*Store) VisitorList ¶
func (store *Store) VisitorList(ctx context.Context, options VisitorQueryOptions) ([]VisitorInterface, error)
func (*Store) VisitorRegister ¶
func (*Store) VisitorSoftDelete ¶
func (store *Store) VisitorSoftDelete(ctx context.Context, visitor VisitorInterface) error
func (*Store) VisitorSoftDeleteByID ¶
func (*Store) VisitorUpdate ¶
func (store *Store) VisitorUpdate(ctx context.Context, visitor VisitorInterface) error
type StoreInterface ¶
type StoreInterface interface { AutoMigrate() error DB() *sql.DB EnableDebug(debug bool) VisitorCount(ctx context.Context, options VisitorQueryOptions) (int64, error) VisitorCreate(ctx context.Context, user VisitorInterface) error VisitorDelete(ctx context.Context, user VisitorInterface) error VisitorDeleteByID(ctx context.Context, id string) error VisitorFindByID(ctx context.Context, userID string) (VisitorInterface, error) VisitorList(ctx context.Context, options VisitorQueryOptions) ([]VisitorInterface, error) VisitorRegister(ctx context.Context, r *http.Request) error VisitorSoftDelete(ctx context.Context, user VisitorInterface) error VisitorSoftDeleteByID(ctx context.Context, id string) error VisitorUpdate(ctx context.Context, user VisitorInterface) error }
type Visitor ¶
type Visitor struct {
dataobject.DataObject
}
func (*Visitor) CreatedAtCarbon ¶
func (visitor *Visitor) CreatedAtCarbon() carbon.Carbon
func (*Visitor) DeletedAtCarbon ¶
func (visitor *Visitor) DeletedAtCarbon() carbon.Carbon
func (*Visitor) Fingerprint ¶ added in v0.1.0
func (*Visitor) FingerprintCalculate ¶ added in v0.1.0
func (*Visitor) SetCountry ¶
func (visitor *Visitor) SetCountry(country string) VisitorInterface
func (*Visitor) SetCreatedAt ¶
func (visitor *Visitor) SetCreatedAt(createdAt string) VisitorInterface
func (*Visitor) SetDeletedAt ¶
func (visitor *Visitor) SetDeletedAt(deletedAt string) VisitorInterface
func (*Visitor) SetFingerprint ¶ added in v0.1.0
func (visitor *Visitor) SetFingerprint(fingerprint string) VisitorInterface
func (*Visitor) SetID ¶
func (visitor *Visitor) SetID(id string) VisitorInterface
func (*Visitor) SetIpAddress ¶
func (visitor *Visitor) SetIpAddress(ipAddress string) VisitorInterface
func (*Visitor) SetPath ¶
func (visitor *Visitor) SetPath(path string) VisitorInterface
func (*Visitor) SetUpdatedAt ¶
func (visitor *Visitor) SetUpdatedAt(updatedAt string) VisitorInterface
func (*Visitor) SetUserAcceptEncoding ¶
func (visitor *Visitor) SetUserAcceptEncoding(userAcceptEncoding string) VisitorInterface
func (*Visitor) SetUserAcceptLanguage ¶
func (visitor *Visitor) SetUserAcceptLanguage(userAcceptLanguage string) VisitorInterface
func (*Visitor) SetUserAgent ¶
func (visitor *Visitor) SetUserAgent(userAgent string) VisitorInterface
func (*Visitor) SetUserBrowser ¶
func (visitor *Visitor) SetUserBrowser(userBrowser string) VisitorInterface
func (*Visitor) SetUserBrowserVersion ¶
func (visitor *Visitor) SetUserBrowserVersion(userBrowserVersion string) VisitorInterface
func (*Visitor) SetUserDevice ¶
func (visitor *Visitor) SetUserDevice(userDevice string) VisitorInterface
func (*Visitor) SetUserDeviceType ¶
func (visitor *Visitor) SetUserDeviceType(userDeviceType string) VisitorInterface
func (*Visitor) SetUserOs ¶
func (visitor *Visitor) SetUserOs(userOs string) VisitorInterface
func (*Visitor) SetUserOsVersion ¶
func (visitor *Visitor) SetUserOsVersion(userOsVersion string) VisitorInterface
func (*Visitor) SetUserReferrer ¶
func (visitor *Visitor) SetUserReferrer(userReferrer string) VisitorInterface
func (*Visitor) UpdatedAtCarbon ¶
func (visitor *Visitor) UpdatedAtCarbon() carbon.Carbon
func (*Visitor) UserAcceptEncoding ¶
func (*Visitor) UserAcceptLanguage ¶
func (*Visitor) UserBrowser ¶
func (*Visitor) UserBrowserVersion ¶
func (*Visitor) UserDevice ¶
func (*Visitor) UserDeviceType ¶
func (*Visitor) UserOsVersion ¶
func (*Visitor) UserReferrer ¶
type VisitorInterface ¶
type VisitorInterface interface { // From dataobject Data() map[string]string DataChanged() map[string]string MarkAsNotDirty() Path() string SetPath(path string) VisitorInterface Country() string SetCountry(country string) VisitorInterface CreatedAt() string CreatedAtCarbon() carbon.Carbon SetCreatedAt(createdAt string) VisitorInterface DeletedAt() string SetDeletedAt(deletedAt string) VisitorInterface Fingerprint() string FingerprintCalculate() string SetFingerprint(fingerprint string) VisitorInterface ID() string SetID(id string) VisitorInterface IpAddress() string SetIpAddress(ip string) VisitorInterface UserAcceptLanguage() string SetUserAcceptLanguage(userAcceptLanguage string) VisitorInterface UserAcceptEncoding() string SetUserAcceptEncoding(userAcceptEncoding string) VisitorInterface UserAgent() string SetUserAgent(userAgent string) VisitorInterface UserBrowser() string SetUserBrowser(userBrowser string) VisitorInterface UserBrowserVersion() string SetUserBrowserVersion(userBrowserVersion string) VisitorInterface UserDevice() string SetUserDevice(userDevice string) VisitorInterface UserDeviceType() string SetUserDeviceType(userDeviceType string) VisitorInterface UserOs() string SetUserOs(userOs string) VisitorInterface UserOsVersion() string SetUserOsVersion(userOsVersion string) VisitorInterface UserReferrer() string SetUserReferrer(userReferrer string) VisitorInterface // Memo() string // SetMemo(memo string) UserInterface // Meta(name string) string // SetMeta(name string, value string) error // Metas() (map[string]string, error) // SetMetas(metas map[string]string) error // Status() string // SetStatus(status string) UserInterface UpdatedAt() string UpdatedAtCarbon() carbon.Carbon SetUpdatedAt(updatedAt string) VisitorInterface }
func NewVisitor ¶
func NewVisitor() VisitorInterface
func NewVisitorFromExistingData ¶
func NewVisitorFromExistingData(data map[string]string) VisitorInterface
type VisitorQueryOptions ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.