Documentation
¶
Index ¶
- Constants
- type IMongoMapper
- type Interface
- type MongoMapper
- func (m *MongoMapper) Delete(ctx context.Context, id string) error
- func (m *MongoMapper) FindAndCount(ctx context.Context, p *basic.PaginationOptions) ([]*Interface, int64, error)
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (i *Interface, err error)
- func (m *MongoMapper) FindOneByURLAndMethod(ctx context.Context, rawURL string, method string) (i *Interface, err error)
- func (m *MongoMapper) Insert(ctx context.Context, i *Interface) error
- func (m *MongoMapper) Update(ctx context.Context, i *Interface) error
Constants ¶
View Source
const (
CollectionName = "base"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMongoMapper ¶
type IMongoMapper interface { Insert(ctx context.Context, i *Interface) error Update(ctx context.Context, i *Interface) error FindAndCount(ctx context.Context, p *basic.PaginationOptions) ([]*Interface, int64, error) FindOne(ctx context.Context, id string) (i *Interface, err error) FindOneByURLAndMethod(ctx context.Context, rawURL string, method string) (i *Interface, err error) Delete(ctx context.Context, id string) error }
type Interface ¶
type Interface struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` Name string `bson:"name" json:"name"` Host string `bson:"host" json:"host"` Path string `bson:"path" json:"path"` Method int64 `bson:"method" json:"method"` PassWay int64 `bson:"passWay" json:"passWay"` Params map[string]string `bson:"params" json:"params"` Content string `bson:"content" json:"content"` Status int64 `bson:"status" json:"status"` CreateTime time.Time `bson:"create_time" json:"createTime"` UpdateTime time.Time `bson:"update_time" json:"updateTime"` DeleteTime time.Time `bson:"delete_time,omitempty" json:"deleteTime,omitempty"` }
type MongoMapper ¶
type MongoMapper struct {
// contains filtered or unexported fields
}
func NewMongoMapper ¶
func NewMongoMapper(config *config.Config) *MongoMapper
func (*MongoMapper) FindAndCount ¶
func (m *MongoMapper) FindAndCount(ctx context.Context, p *basic.PaginationOptions) ([]*Interface, int64, error)
func (*MongoMapper) FindOneByURLAndMethod ¶
Click to show internal directories.
Click to hide internal directories.