Documentation ¶
Overview ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Initialize ¶
func Initialize(servingOptions *modeloptions.ServingOptions)
Initialize will be called in startup to initialize all internal model factory
func NewCacheID ¶
func RegisterFactory ¶
func RegisterFactory(model interface{}, f Factory)
RegisterFactory will add model factory. user can also add customized model factory
Types ¶
type Factory ¶
type Factory interface { // Save a newly created object into factory Save(Owner, models.Model) (models.Model, error) // List return object sets accoroding to query List(Owner, *models.Query) ([]models.Model, error) // Get return a specified object Get(Owner, string) (models.Model, error) // Delete will delete specified object in factory Delete(Owner, string) error // Update update object in factory Update(Owner, models.Model) error }
Factory will create and manage object
func NewFactory ¶
func NewFactory(obj interface{}) Factory
NewFactory create and return model factory