// itemFromGithubConnector attempts to encode the supplied github connector
// as an instance of `backend.Item` suitable for storage.
itemFromGithubConnector attempts to encode the supplied github connector
as an instance of `backend.Item` suitable for storage.
// itemFromGithubConnector attempts to encode the supplied github connector // as an instance of ` backend . Item ` suitable for storage .
func itemFromGithubConnector(gc services.GithubConnector) (*backend.Item, error) {
	if err := gc.CheckAndSetDefaults(); err != nil {
		return nil, trace.Wrap(err)
	}
	value, err := services.GetGithubConnectorMarshaler().Marshal(gc)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	item := &backend.Item{
		Key:     backend.Key(webPrefix, connectorsPrefix, githubPrefix, connectorsPrefix, gc.GetName()),
		Value:   value,
		Expires: gc.Expiry(),
		ID:      gc.GetResourceID(),
	}
	return item, nil
}
func itemFromGithubConnector ( gc services . GithubConnector ) ( * backend . Item , error ) { if err := gc . CheckAndSetDefaults ( ) ; err != nil { return nil , trace . Wrap ( err ) } value , err := services . GetGithubConnectorMarshaler ( ) . Marshal ( gc ) if err != nil { return nil , trace . Wrap ( err ) } item := & backend . Item { Key : backend . Key ( webPrefix , connectorsPrefix , githubPrefix , connectorsPrefix , gc . GetName ( ) ) , Value : value , Expires : gc . Expiry ( ) , ID : gc . GetResourceID ( ) , } return item , nil }
itemFromGithubConnector attempts to encode the supplied github connector
as an instance of `backend.Item` suitable for storage.
itemFromGithubConnector attempts to encode the supplied github connector as an instance of ` backend . Item ` suitable for storage .