Documentation
¶
Overview ¶
Package xo contains generated code for schema 'cloud-run-api-emulator.db'.
Index ¶
- Variables
- func Errorf(s string, v ...interface{})
- func Logf(s string, v ...interface{})
- func SetErrorLogger(logger interface{})
- func SetLogger(logger interface{})
- type DB
- type ErrInsertFailed
- type ErrInvalidTime
- type ErrUpdateFailed
- type ErrUpsertFailed
- type Error
- type ListNextServices
- type ListServiceAnnotations
- type ListServices
- type Service
- func (s *Service) Delete(ctx context.Context, db DB) error
- func (s *Service) Deleted() bool
- func (s *Service) Exists() bool
- func (s *Service) Insert(ctx context.Context, db DB) error
- func (s *Service) Save(ctx context.Context, db DB) error
- func (s *Service) Update(ctx context.Context, db DB) error
- func (s *Service) Upsert(ctx context.Context, db DB) error
- type ServiceAnnotation
- func (sa *ServiceAnnotation) Delete(ctx context.Context, db DB) error
- func (sa *ServiceAnnotation) Deleted() bool
- func (sa *ServiceAnnotation) Exists() bool
- func (sa *ServiceAnnotation) Insert(ctx context.Context, db DB) error
- func (sa *ServiceAnnotation) Save(ctx context.Context, db DB) error
- func (sa *ServiceAnnotation) Update(ctx context.Context, db DB) error
- func (sa *ServiceAnnotation) Upsert(ctx context.Context, db DB) error
- type ServiceLabel
- func (sl *ServiceLabel) Delete(ctx context.Context, db DB) error
- func (sl *ServiceLabel) Deleted() bool
- func (sl *ServiceLabel) Exists() bool
- func (sl *ServiceLabel) Insert(ctx context.Context, db DB) error
- func (sl *ServiceLabel) Save(ctx context.Context, db DB) error
- func (sl *ServiceLabel) Update(ctx context.Context, db DB) error
- func (sl *ServiceLabel) Upsert(ctx context.Context, db DB) error
- type Time
- func (t Time) Format(layout string) string
- func (t Time) MarshalJSON() ([]byte, error)
- func (t *Time) Parse(s string) error
- func (t *Time) Scan(v interface{}) error
- func (t Time) String() string
- func (t Time) Time() time.Time
- func (t *Time) UnmarshalJSON(data []byte) error
- func (t Time) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
var TimestampFormats = []string{
"2006-01-02 15:04:05.999999999-07:00",
"2006-01-02T15:04:05.999999999-07:00",
"2006-01-02 15:04:05.999999999",
"2006-01-02T15:04:05.999999999",
"2006-01-02 15:04:05",
"2006-01-02T15:04:05",
"2006-01-02 15:04",
"2006-01-02T15:04",
"2006-01-02",
}
TimestampFormats are the timestamp formats used by SQLite3 database drivers to store a time.Time in SQLite3.
The first format in the slice will be used when saving time values into the database. When parsing a string from a timestamp or datetime column, the formats are tried in order.
Functions ¶
func Errorf ¶
func Errorf(s string, v ...interface{})
Errorf logs an error message using the package error logger.
func SetErrorLogger ¶
func SetErrorLogger(logger interface{})
SetErrorLogger sets the package error logger. Valid logger types:
io.Writer func(string, ...interface{}) (int, error) // fmt.Printf func(string, ...interface{}) // log.Printf
Types ¶
type DB ¶
type DB interface { ExecContext(context.Context, string, ...interface{}) (sql.Result, error) QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) QueryRowContext(context.Context, string, ...interface{}) *sql.Row }
DB is the common interface for database operations that can be used with types from schema 'cloud-run-api-emulator.db'.
This works with both database/sql.DB and database/sql.Tx.
type ErrInsertFailed ¶
type ErrInsertFailed struct {
Err error
}
ErrInsertFailed is the insert failed error.
func (*ErrInsertFailed) Error ¶
func (err *ErrInsertFailed) Error() string
Error satisfies the error interface.
func (*ErrInsertFailed) Unwrap ¶
func (err *ErrInsertFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type ErrInvalidTime ¶
type ErrInvalidTime string
ErrInvalidTime is the invalid Time error.
func (ErrInvalidTime) Error ¶
func (err ErrInvalidTime) Error() string
Error satisfies the error interface.
type ErrUpdateFailed ¶
type ErrUpdateFailed struct {
Err error
}
ErrUpdateFailed is the update failed error.
func (*ErrUpdateFailed) Error ¶
func (err *ErrUpdateFailed) Error() string
Error satisfies the error interface.
func (*ErrUpdateFailed) Unwrap ¶
func (err *ErrUpdateFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type ErrUpsertFailed ¶
type ErrUpsertFailed struct {
Err error
}
ErrUpsertFailed is the upsert failed error.
func (*ErrUpsertFailed) Error ¶
func (err *ErrUpsertFailed) Error() string
Error satisfies the error interface.
func (*ErrUpsertFailed) Unwrap ¶
func (err *ErrUpsertFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type Error ¶
type Error string
Error is an error.
const ( // ErrAlreadyExists is the already exists error. ErrAlreadyExists Error = "already exists" // ErrDoesNotExist is the does not exist error. ErrDoesNotExist Error = "does not exist" // ErrMarkedForDeletion is the marked for deletion error. ErrMarkedForDeletion Error = "marked for deletion" )
Error values.
type ListNextServices ¶
type ListNextServices struct { Parent string `json:"parent"` // parent Name string `json:"name"` // name Description string `json:"description"` // description UID string `json:"uid"` // uid URI string `json:"uri"` // uri Generation int64 `json:"generation"` // generation CreatedAt Time `json:"created_at"` // created_at }
ListNextServices represents a row from 'list_next_services'.
func ListNextServicesByParentCreatedAtNameLimit ¶
func ListNextServicesByParentCreatedAtNameLimit(ctx context.Context, db DB, parent, created_at, name string, limit int32) ([]*ListNextServices, error)
ListNextServicesByParentCreatedAtNameLimit runs a custom query, returning results as ListNextServices.
type ListServiceAnnotations ¶ added in v0.0.2
type ListServiceAnnotations struct { ServiceParent string `json:"service_parent"` // service_parent ServiceName string `json:"service_name"` // service_name Key string `json:"key"` // key Value string `json:"value"` // value }
ListServiceAnnotations represents a row from 'list_service_annotations'.
func ListServiceAnnotationsByParentName ¶ added in v0.0.2
func ListServiceAnnotationsByParentName(ctx context.Context, db DB, parent, name string) ([]*ListServiceAnnotations, error)
ListServiceAnnotationsByParentName runs a custom query, returning results as ListServiceAnnotations.
type ListServices ¶
type ListServices struct { Parent string `json:"parent"` // parent Name string `json:"name"` // name Description string `json:"description"` // description UID string `json:"uid"` // uid URI string `json:"uri"` // uri Generation int64 `json:"generation"` // generation CreatedAt Time `json:"created_at"` // created_at }
ListServices represents a row from 'list_services'.
func ListServicesByParentLimit ¶
func ListServicesByParentLimit(ctx context.Context, db DB, parent string, limit int32) ([]*ListServices, error)
ListServicesByParentLimit runs a custom query, returning results as ListServices.
type Service ¶
type Service struct { Parent string `json:"parent"` // parent Name string `json:"name"` // name Description string `json:"description"` // description UID string `json:"uid"` // uid Generation int64 `json:"generation"` // generation URI string `json:"uri"` // uri CreatedAt Time `json:"created_at"` // created_at // contains filtered or unexported fields }
Service represents a row from 'services'.
func ServiceByParentName ¶
ServiceByParentName retrieves a row from 'services' as a Service.
Generated from index 'sqlite_autoindex_services_1'.
func ServicesByCreatedAt ¶
ServicesByCreatedAt retrieves a row from 'services' as a Service.
Generated from index 'created_at_desc'.
func (*Service) Deleted ¶
Deleted returns true when the Service has been marked for deletion from the database.
type ServiceAnnotation ¶
type ServiceAnnotation struct { ServiceParent string `json:"service_parent"` // service_parent ServiceName string `json:"service_name"` // service_name Key string `json:"key"` // key Value string `json:"value"` // value // contains filtered or unexported fields }
ServiceAnnotation represents a row from 'service_annotations'.
func ServiceAnnotationByServiceParentServiceNameKey ¶
func ServiceAnnotationByServiceParentServiceNameKey(ctx context.Context, db DB, serviceParent, serviceName, key string) (*ServiceAnnotation, error)
ServiceAnnotationByServiceParentServiceNameKey retrieves a row from 'service_annotations' as a ServiceAnnotation.
Generated from index 'sqlite_autoindex_service_annotations_1'.
func (*ServiceAnnotation) Delete ¶
func (sa *ServiceAnnotation) Delete(ctx context.Context, db DB) error
Delete deletes the ServiceAnnotation from the database.
func (*ServiceAnnotation) Deleted ¶
func (sa *ServiceAnnotation) Deleted() bool
Deleted returns true when the ServiceAnnotation has been marked for deletion from the database.
func (*ServiceAnnotation) Exists ¶
func (sa *ServiceAnnotation) Exists() bool
Exists returns true when the ServiceAnnotation exists in the database.
func (*ServiceAnnotation) Insert ¶
func (sa *ServiceAnnotation) Insert(ctx context.Context, db DB) error
Insert inserts the ServiceAnnotation to the database.
func (*ServiceAnnotation) Save ¶
func (sa *ServiceAnnotation) Save(ctx context.Context, db DB) error
Save saves the ServiceAnnotation to the database.
func (*ServiceAnnotation) Update ¶
func (sa *ServiceAnnotation) Update(ctx context.Context, db DB) error
Update updates a ServiceAnnotation in the database.
func (*ServiceAnnotation) Upsert ¶
func (sa *ServiceAnnotation) Upsert(ctx context.Context, db DB) error
Upsert performs an upsert for ServiceAnnotation.
type ServiceLabel ¶
type ServiceLabel struct { ServiceParent string `json:"service_parent"` // service_parent ServiceName string `json:"service_name"` // service_name Key string `json:"key"` // key Value string `json:"value"` // value // contains filtered or unexported fields }
ServiceLabel represents a row from 'service_labels'.
func ServiceLabelByServiceParentServiceNameKey ¶
func ServiceLabelByServiceParentServiceNameKey(ctx context.Context, db DB, serviceParent, serviceName, key string) (*ServiceLabel, error)
ServiceLabelByServiceParentServiceNameKey retrieves a row from 'service_labels' as a ServiceLabel.
Generated from index 'sqlite_autoindex_service_labels_1'.
func (*ServiceLabel) Delete ¶
func (sl *ServiceLabel) Delete(ctx context.Context, db DB) error
Delete deletes the ServiceLabel from the database.
func (*ServiceLabel) Deleted ¶
func (sl *ServiceLabel) Deleted() bool
Deleted returns true when the ServiceLabel has been marked for deletion from the database.
func (*ServiceLabel) Exists ¶
func (sl *ServiceLabel) Exists() bool
Exists returns true when the ServiceLabel exists in the database.
func (*ServiceLabel) Insert ¶
func (sl *ServiceLabel) Insert(ctx context.Context, db DB) error
Insert inserts the ServiceLabel to the database.
func (*ServiceLabel) Save ¶
func (sl *ServiceLabel) Save(ctx context.Context, db DB) error
Save saves the ServiceLabel to the database.
func (*ServiceLabel) Update ¶
func (sl *ServiceLabel) Update(ctx context.Context, db DB) error
Update updates a ServiceLabel in the database.
func (*ServiceLabel) Upsert ¶
func (sl *ServiceLabel) Upsert(ctx context.Context, db DB) error
Upsert performs an upsert for ServiceLabel.
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time is a SQLite3 Time that scans for the various timestamps values used by SQLite3 database drivers to store time.Time values.
func (Time) MarshalJSON ¶
MarshalJSON satisfies the [json.Marshaler] interface.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON satisfies the [json.Unmarshaler] interface.